You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/06/05 00:15:41 UTC

[01/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Repository: airavata-php-gateway
Updated Branches:
  refs/heads/master 71890a7fa -> 2fbd92892


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/resource/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/edit.blade.php b/app/views/resource/edit.blade.php
index 5cd33cc..b41e766 100644
--- a/app/views/resource/edit.blade.php
+++ b/app/views/resource/edit.blade.php
@@ -1,592 +1,654 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/style.css') }}
+@parent
+{{ HTML::style('css/style.css') }}
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-
-		<input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
-
-		<div class="well">
-			<h4>Compute Resource : {{ $computeResource->hostName }}</h4>
-		</div>
-		@if( Session::has("message"))
-			<span class="alert alert-success col-md-12">{{Session::get("message")}}</span>
-			{{Session::forget("message") }}
-		@endif
-
-		<div class="col-md-12">
-			<ul class="nav nav-tabs nav-justified" id="tabs" role="tablist">
-			  <li class="active"><a href="#tab-desc" data-toggle="tab">Description</a></li>
-			  <li><a href="#tab-queues" data-toggle="tab">Queues</a></a></li>
-			  <li><a href="#tab-filesystem" data-toggle="tab">FileSystem</a></li>
-			  <li><a href="#tab-jobSubmission" data-toggle="tab">Job Submission Interfaces</a></li>
-			  <li><a href="#tab-dataMovement" data-toggle="tab">Data Movement Interfaces</a></li>
-			</ul>
-		</div>
-
-		<div class="tab-content">
-        	
-        	<div class="tab-pane active" id="tab-desc">
-
-				<form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
-					<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-					<input type="hidden" name="cr-edit" value="resDesc"/>
-					<div class="form-group required">
-						<label class="control-label">Host Name</label>
-						<input class="form-control hostName" value="{{ $computeResource->hostName }}" maxlength="100" name="hostname" required="required"/>
-					</div>
-					<div class="form-group">
-						<label class="control-label">Host Aliases</label>
-						@if( count(  $computeResource->hostAliases) )
-							@foreach( $computeResource->hostAliases as $hostAlias )
-								<input class="form-control" value="{{$hostAlias}}" maxlength="30" name="hostaliases[]"/>
-							@endforeach
-						@else
-							<input class="form-control" value="" maxlength="30" name="hostaliases[]"/>
-						@endif
-						<button type="button" class="btn btn-sm btn-default add-alias">Add Aliases</button>
-					</div>
-					<div class="form-group">
-						<label class="control-label">IP Addresses</label>
-						@if( count( $computeResource->ipAddresses))
-							@foreach( $computeResource->ipAddresses as $ip )
-								<input class="form-control" value="{{ $ip }}" maxlength="30" name="ips[]"/>
-							@endforeach
-						@else
-							<input class="form-control" value="" maxlength="30" name="ips[]"/>
-						@endif
-						<button type="button" class="btn btn-sm btn-default add-ip">Add IP Addresses</button>
-					</div>
-					<div class="form-group">
-						<label class="control-label">Resource Description</label>
-						<textarea class="form-control" maxlength="255" name="description">{{ $computeResource->resourceDescription }}</textarea>
-					</div>
-					<div class="form-group">
-						<label class="control-label">Maximum Memory Per Node ( In MB )</label>
-						<input type="number" min="0" class="form-control" value="{{ $computeResource->maxMemoryPerNode }}" maxlength="30" name="maxMemoryPerNode"/>
-					</div>
-					<div class="form-group">
-						<input type="submit" class="btn btn-primary" name="step1" value="Save changes"/>
-					</div>
-
-				</form>
-
-			</div>
-
-        	<div class="tab-pane" id="tab-queues">
-
-        		@if( is_array( $computeResource->batchQueues) )
-					<h3>Existing Queues :</h3>
-					<div class="panel-group" id="accordion">
-					@foreach( $computeResource->batchQueues as $index => $queue)
-						<div class="panel panel-default">
-							<div class="panel-heading">
-								<h4 class="panel-title">
-									<a class="accordion-toggle collapsed existing-queue-name" data-toggle="collapse" data-parent="#accordion" href="#collapse-{{$index}}">{{ $queue->queueName }}</a>
-									<div class="pull-right col-md-1">
-										<span class="glyphicon glyphicon-trash delete-queue" style="cursor:pointer;" data-toggle="modal" data-target="#delete-queue" data-queue-name="{{ $queue->queueName }}"></span>
-									</div>
-								</h4>
-							</div>
-							<div id="collapse-{{$index}}" class="panel-collapse collapse">
-								<div class="panel-body">
-									<form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
-										<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-										<div class="queue">
-											<input type="hidden" name="cr-edit" value="queue"/>
-											<div class="form-group required">
-												<label class="control-label">Queue Name <small> ( cannot be changed.) </small></label>
-												<input class="form-control" value="{{ $queue->queueName }}" maxlength="30" name="qname" placeholder="Queue Name" readonly />
-											</div>
-											@include('partials/queue-block', array('queueData'=>$queue))
-						          			<div class="form-group">
-												<input type="submit" min="0" class="btn" name="step1" value="Update"/>
-											</div>
-						          		</div>
-						      		</form>
-						      	</div>
-						    </div>
-						</div>
-			  		@endforeach
-			  		</div>
-			  	@endif
-				<div class="queue-block hide">
-					<form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
-						<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-						<div class="queue">
-							<div class="queue">
-								<input type="hidden" name="cr-edit" value="queue"/>
-								<div class="form-group required">
-									<label class="control-label">Queue Name<small> ( A queue name is unique and cannot be changed later.)</small></label>
-									<input class="form-control create-queue-name" maxlength="30" name="qname" placeholder="Queue Name" required="required"/>
-								</div>
-								@include('partials/queue-block')
-								
-			          		</div>
-		          			<div class="form-group">
-								<input type="button" class="btn create-queue-form btn-primary" name="step1" value="Create"/>
-								<input type="reset" class="btn  btn-success" value="Reset"/>
-							</div>
-		          		</div>
-		      		</form>
-		      	</div>
-				<div class="form-group well add-queue-block">
-					<button type="button" class="btn btn-sm btn-default add-queue">Add a Queue</button>
-				</div>
-
-			</div>
-
-        	<div class="tab-pane" id="tab-filesystem">
-
-        		<form role="form" method="POST" action="{{URL::to('/')}}/cr/edit">
-					<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-					<input type="hidden" name="cr-edit" value="fileSystems"/>
-					<div class="form-group">
-						<h3>FileSystem</h3>
-						@foreach( $fileSystems as $index => $fileSystem)
-							<label class="control-label">{{ $fileSystem }}</label>
-							<input class="form-control" name="fileSystems[{{ $index }}]" placeholder="{{ $fileSystem }}" value="@if( isset( $computeResource->fileSystems[ $index]) ){{ $computeResource->fileSystems[ $index] }} @endif"/>
-						@endforeach
-						</select>
-					</div>
-					<div class="form-group">
-						<button class="btn btn-prim">Update</button>
-					</div>
-				</form>
-
-			</div>
-
-        	<div class="tab-pane" id="tab-jobSubmission">
-
-        		<div class="form-group">
-					<div class="job-submission-info row hide"></div>
-					<button type="button" class="btn btn-sm btn-default add-job-submission">Add a new Job Submission Interface</button>
-					@if( count( $jobSubmissionInterfaces ) > 1)
-        				<button type="button" class="btn btn-sm btn-default update-priority" data-type="jsi" data-toggle="modal" data-target="#update-jsi-priority">Update Priority</button>
-        			@endif
-				</div>
-
-        		@if( count( $jobSubmissionInterfaces ) )
-        			<div class="job-edit-info">
-        			@foreach( $jobSubmissionInterfaces as $index => $JSI )
-
-        				<div class="job-protocol-block">
-							<form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
-								<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-								<input type="hidden" name="cr-edit" value="edit-jsp"/>
-								<input type="hidden" name="jsiId" value="{{ $JSI->jobSubmissionInterfaceId }}"/>
-								<?php $selectedJspIndex = $computeResource->jobSubmissionInterfaces[ $index]->jobSubmissionProtocol; ?>
-
-        						<h4>Job Submission Protocol : {{ $jobSubmissionProtocols[ $selectedJspIndex] }}
-									<button type='button' class='close delete-jsi' data-toggle="modal" data-target="#confirm-delete-jsi" data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}">
-										<span class="glyphicon glyphicon-trash delete-jsi" data-toggle="modal" data-target="#confirm-delete-jsi" data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}"></span>
-									</button>
-								</h4>
-								<input type="hidden" name="jobSubmissionProtocol" value="{{ $selectedJspIndex }}"/>
-								@if( $selectedJspIndex == $jobSubmissionProtocolsObject::LOCAL)
-									<div class="select-resource-manager-type">
-										<div class="form-group required">
-											<label class="control-label">Select resource manager type</label>
-											<select name="resourceJobManagerType" class="form-control selected-resource-manager" required="required">
-											@foreach( $resourceJobManagerTypes as $index => $rJmT)
-												<option value="{{ $index }}" @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT }}</option>
-											@endforeach
-											</select>
-										</div>
-										<div class="form-group">
-											<label class="control-label">Push Monitoring End Point</label>
-											<input type="text" class="form-control" name="pushMonitoringEndpoint" value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
-										</div>
-										<div class="form-group">
-											<label class="control-label">Job Manager Bin Path</label>
-											<input type="text" class="form-control" name="jobManagerBinPath" value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
-										</div>
-										<div class="form-group">
-											<h3>Job Manager Commands</h3>
-											@foreach( $jobManagerCommands as $index => $jmc)
-												<label class="control-label">{{ $jmc }}</label>
-												<input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}" value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
-											@endforeach
-											</select>
-										</div>
-									</div>
-								@elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::SSH)
-									<div class="form-group required">		
-										<label class="control-label">Select Security Protocol</label>
-										<select name="securityProtocol" required="required">
-										@foreach( $securityProtocols as $index => $sp)
-											<option value="{{ $index }}" @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
-										@endforeach
-										</select>
-									</div>
-
-									<div class="form-group">
-										<label class="control-label">Alternate SSH Host Name</label>
-						                <input class='form-control' name='alternativeSSHHostName' value="{{ $JSI->alternativeSSHHostName}}"/>
-						            </div>
-						            <div class="form-group">
-										<label class="control-label">SSH Port</label>
-						                <input class='form-control' name='sshPort' value="{{ $JSI->sshPort }}"/>
-						            </div>
-
-						            <div class="form-group required">
-										<label class="control-label">Select Monitoring Mode</label>
-						            	<select name="monitorMode" required>
-						            		@foreach( $monitorModes as $index => $mode)
-						            			<option value="{{ $index }}" @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
-						            		@endforeach
-						            	</select>
-						            </div>
-
-									<div class="form-group">
-										<div class="select-resource-manager-type">
-											<div class="form-group required">
-												<label class="control-label">Select resource manager type</label>
-												<select name="resourceJobManagerType" class="form-control selected-resource-manager" required="required">
-												@foreach( $resourceJobManagerTypes as $index => $rJmT)
-													<option value="{{ $index }}" @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT }}</option>
-												@endforeach
-												</select>
-											</div>
-											<div class="form-group">
-												<label class="control-label">Push Monitoring End Point</label>
-												<input type="text" class="form-control" name="pushMonitoringEndpoint" value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
-											</div>
-											<div class="form-group">
-												<label class="control-label">Job Manager Bin Path</label>
-												<input type="text" class="form-control" name="jobManagerBinPath" value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
-											</div>
-											<div class="form-group">
-												<h3>Job Manager Commands</h3>
-												@foreach( $jobManagerCommands as $index => $jmc)
-													<label class="control-label">{{ $jmc }}</label>
-													<input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}" value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
-												@endforeach
-											</div>
-										</div>
-									</div>
-						            
-								@elseif(  $selectedJspIndex == $jobSubmissionProtocolsObject::UNICORE)
-									<div class="form-group required">		
-										<label class="control-label">Select Security Protocol</label>
-										<select name="securityProtocol" required="required">
-										@foreach( $securityProtocols as $index => $sp)
-											<option value="{{ $index }}" @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
-										@endforeach
-										</select>
-									</div>
-									<div class="form-group">
-										<label class="form-label">Unicore End Point URL</label>
-										<input class='form-control' name='unicoreEndPointURL' value="{{ $JSI->unicoreEndPointURL }}"/>
-									</div>
-								@endif
-								<div class="form-group">
-									<button type="submit" class="btn">Update</button>
-								</div>
-							</form>
-
-						</div>
-        			@endforeach
-        			</div>
-        		@endif
-
-				<div class="select-job-protocol hide">
-					<form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
-						<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-						<input type="hidden" name="cr-edit" value="jsp"/>
-						
-						<div class="form-group">
-							<label class="control-label">Job Submission Protocol:</label>
-							<select name="jobSubmissionProtocol" class="form-control selected-job-protocol" required="required">
-								<option></option>
-							@foreach( $jobSubmissionProtocols as $index => $jobSubmissionProtocol)
-								@if( ! in_array( $index, $addedJSP))
-									<option value="{{ $index }}">{{ $jobSubmissionProtocol }}</option>
-								@endif
-							@endforeach
-							</select>
-						</div>
-
-						<div class="form-group">
-							<button type="submit" class="btn btn-primary jspSubmit hide">Add Job Submission Protocol</button>
-						</div>
-					</form>
-				</div>
-
-        	</div>
-
-        	<div class="tab-pane" id="tab-dataMovement">
-
-				<div class="form-group">
-					<div class="data-movement-info row hide"></div>
-					<button type="button" class="btn btn-sm btn-default add-data-movement">Add a new Data Movement Interface</button>
-        			@if( count( $dataMovementInterfaces ) > 1)
-						<button type="button" class="btn btn-sm btn-default update-priority" data-type="dmi"  data-toggle="modal" data-target="#update-dmi-priority">Update Priority</button>
-					@endif				
-				</div>
-
-        		@if( count( $dataMovementInterfaces ) )
-        			<div class="job-edit-info">
-        			@foreach( $dataMovementInterfaces as $index => $DMI )
-        				<div class="data-movement-block">
-							<form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
-								<input type="hidden" name="crId" class="crId" value="{{Input::get('crId') }}"/>
-								<input type="hidden" name="cr-edit" value="edit-dmi"/>
-								<input type="hidden" name="dmiId" value="{{ $DMI->dataMovementInterfaceId }}"/>
-
-								<?php $selectedDMIIndex = $computeResource->dataMovementInterfaces[ $index]->dataMovementProtocol; ?>
-
-        						<h4>Data Movement Protocol : {{ $dataMovementProtocols[ $selectedDMIIndex] }}
-									<button type='button' class='close delete-dmi' data-toggle="modal" data-target="#confirm-delete-dmi" data-dmi-id="{{ $DMI->dataMovementInterfaceId }}">
-										<span class="glyphicon glyphicon-trash delete-dmi" data-toggle="modal" data-target="#confirm-delete-dmi" data-dmi-id="{{ $DMI->dataMovementInterfaceId }}"></span>
-									</button>
-								</h4>
-								<input type="hidden" name="dataMovementProtocol" value="{{ $selectedDMIIndex }}"/>
-								@if( $selectedDMIIndex == $dataMovementProtocolsObject::LOCAL)
-									<!-- Nothing here on local UI -->
-								@elseif( $selectedDMIIndex == $dataMovementProtocolsObject::SCP)
-									<div class="form-group">		
-										<label class="control-label">Select Security Protocol</label>
-										<select name="securityProtocol">
-										@foreach( $securityProtocols as $index => $sp)
-											<option value="{{ $index }}" @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
-										@endforeach
-										</select>
-									</div>
-
-									<div class="form-group">
-										<label class="control-label">Alternate SSH Host Name</label>
-						                <input class='form-control' name='alternativeSSHHostName' value="{{ $DMI->alternativeSCPHostName }}"/>
-						            </div>
-						            <div class="form-group">
-										<label class="control-label">SSH Port</label>
-						                <input class='form-control' name='sshPort' value="{{ $DMI->sshPort }}"/>
-						            </div>
-						            <div class="form-group">
-						            	<button type="submit" class="btn">Update</button>
-						            </div>
-								@elseif( $selectedDMIIndex == $dataMovementProtocolsObject::GridFTP)
-									<div class="form-group">		
-										<label class="control-label">Select Security Protocol</label>
-										<select name="securityProtocol">
-										@foreach( $securityProtocols as $index => $sp)
-											<option value="{{ $index }}" @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
-										@endforeach
-										</select>
-										<div>
-											<div class="form-group required">
-												<label class="control-label">Grid FTP End Points</label>
-												@foreach( $DMI->gridFTPEndPoints as $endPoint)
-													<input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required="required" value="{{$endPoint}}"/>
-												@endforeach
-												<button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP End Points</button>
-											</div>
-										</div>
-										<div class="form-group">
-							            	<button type="submit" class="btn">Update</button>
-							            </div>
-									</div>
-								@elseif( $selectedDMIIndex == $dataMovementProtocolsObject::UNICORE_STORAGE_SERVICE)
-									<div class="form-group">		
-										<label class="control-label">Select Security Protocol</label>
-										<select name="securityProtocol">
-										@foreach( $securityProtocols as $index => $sp)
-											<option value="{{ $index }}" @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
-										@endforeach
-										</select>
-										<div>
-											<div class="form-group required">
-												<label class="control-label">Unicore End Point URL</label>
-												<input class="form-control" maxlength="30" name="unicoreEndPointURL" required="required" value="{{ $DMI->unicoreEndPointURL }}"/>
-											</div>
-										</div>
-										<div class="form-group">
-							            	<button type="submit" class="btn">Update</button>
-							            </div>
-									</div>
-								@endif
-							</form>
-						</div>
-					@endforeach
-					</div>
-				@endif
-        		<div class="select-data-movement hide">
-
-					<form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
-						<input type="hidden" name="crId" class="crId" value="{{Input::get('crId') }}"/>
-						<input type="hidden" name="cr-edit" value="dmp"/>
-						<h4>
-							Select the Data Movement Protocol
-						</h4>
-
-						<select name="dataMovementProtocol" class="form-control selected-data-movement-protocol">
-							<option></option>
-						@foreach( $dataMovementProtocols as $index => $dmp)
-							@if( ! in_array( $index, $addedDMI))
-								<option value="{{ $index }}">{{ $dmp }}</option>
-							@endif
-						@endforeach
-						</select>
-
-						<div class="form-group">
-							<button type="submit" class="btn btn-primary dmpSubmit hide">Add Data Movement Protocol</button>
-						</div>
-
-					</form>
-
-				</div>
-
-        	</div>
-
-
-		</div>
-
-
-		<div class="resource-manager-block hide">
-			<div class="select-resource-manager-type">
-				<div class="form-group required">
-					<label class="control-label">Select resource manager type</label>
-					<select name="resourceJobManagerType" class="form-control selected-resource-manager" required="required">
-					@foreach( $resourceJobManagerTypes as $index => $rJmT)
-						<option value="{{ $index }}">{{ $rJmT }}</option>
-					@endforeach
-					</select>
-				</div>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Push Monitoring End Point</label>
-				<input type="text" class="form-control" name="pushMonitoringEndpoint"/>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Job Manager Bin Path</label>
-				<input type="text" class="form-control" name="jobManagerBinPath"/>
-			</div>
-			<div class="form-group">
-				<h3>Job Manager Commands</h3>
-				@foreach( $jobManagerCommands as $index => $jmc)
-					<label class="control-label">{{ $jmc }}</label>
-					<input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"/>
-				@endforeach
-				</select>
-			</div>
-		</div>
-
-		<div class="ssh-block hide">
-			<div class="form-group required">		
-				<label class="control-label">Select Security Protocol  </label>
-				<select name="securityProtocol" required>
-				@foreach( $securityProtocols as $index => $sp)
-					<option value="{{ $index }}">{{ $sp }}</option>
-				@endforeach
-				</select>
-			</div>
-
-	        <div class="form-group required">
-				<label class="control-label">Select Monitoring Mode  </label>
-	        	<select name="monitorMode" required>
-	        		@foreach( $monitorModes as $index => $mode)
-	        		<option value="{{ $index }}">{{ $mode}}</option>
-	        		@endforeach
-	        	</select>
-	        </div>
-
-			<div class="form-group addedScpValue hide">
-				<label class="control-label">Alternate SSH Host Name</label>
-                <input class='form-control' name='alternativeSSHHostName'/>
+<div class="col-md-offset-2 col-md-8">
+
+<input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
+
+<div class="well">
+    <h4>Compute Resource : {{ $computeResource->hostName }}</h4>
+</div>
+@if( Session::has("message"))
+<span class="alert alert-success col-md-12">{{Session::get("message")}}</span>
+{{Session::forget("message") }}
+@endif
+
+<div class="col-md-12">
+    <ul class="nav nav-tabs nav-justified" id="tabs" role="tablist">
+        <li class="active"><a href="#tab-desc" data-toggle="tab">Description</a></li>
+        <li><a href="#tab-queues" data-toggle="tab">Queues</a></a></li>
+        <li><a href="#tab-filesystem" data-toggle="tab">FileSystem</a></li>
+        <li><a href="#tab-jobSubmission" data-toggle="tab">Job Submission Interfaces</a></li>
+        <li><a href="#tab-dataMovement" data-toggle="tab">Data Movement Interfaces</a></li>
+    </ul>
+</div>
+
+<div class="tab-content">
+
+<div class="tab-pane active" id="tab-desc">
+
+    <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+        <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+        <input type="hidden" name="cr-edit" value="resDesc"/>
+
+        <div class="form-group required">
+            <label class="control-label">Host Name</label>
+            <input class="form-control hostName" value="{{ $computeResource->hostName }}" maxlength="100"
+                   name="hostname" required="required"/>
+        </div>
+        <div class="form-group">
+            <label class="control-label">Host Aliases</label>
+            @if( count( $computeResource->hostAliases) )
+            @foreach( $computeResource->hostAliases as $hostAlias )
+            <input class="form-control" value="{{$hostAlias}}" maxlength="30" name="hostaliases[]"/>
+            @endforeach
+            @else
+            <input class="form-control" value="" maxlength="30" name="hostaliases[]"/>
+            @endif
+            <button type="button" class="btn btn-sm btn-default add-alias">Add Aliases</button>
+        </div>
+        <div class="form-group">
+            <label class="control-label">IP Addresses</label>
+            @if( count( $computeResource->ipAddresses))
+            @foreach( $computeResource->ipAddresses as $ip )
+            <input class="form-control" value="{{ $ip }}" maxlength="30" name="ips[]"/>
+            @endforeach
+            @else
+            <input class="form-control" value="" maxlength="30" name="ips[]"/>
+            @endif
+            <button type="button" class="btn btn-sm btn-default add-ip">Add IP Addresses</button>
+        </div>
+        <div class="form-group">
+            <label class="control-label">Resource Description</label>
+            <textarea class="form-control" maxlength="255" name="description">{{ $computeResource->resourceDescription
+                }}</textarea>
+        </div>
+        <div class="form-group">
+            <label class="control-label">Maximum Memory Per Node ( In MB )</label>
+            <input type="number" min="0" class="form-control" value="{{ $computeResource->maxMemoryPerNode }}"
+                   maxlength="30" name="maxMemoryPerNode"/>
+        </div>
+        <div class="form-group">
+            <input type="submit" class="btn btn-primary" name="step1" value="Save changes"/>
+        </div>
+
+    </form>
+
+</div>
+
+<div class="tab-pane" id="tab-queues">
+
+    @if( is_array( $computeResource->batchQueues) )
+    <h3>Existing Queues :</h3>
+
+    <div class="panel-group" id="accordion">
+        @foreach( $computeResource->batchQueues as $index => $queue)
+        <div class="panel panel-default">
+            <div class="panel-heading">
+                <h4 class="panel-title">
+                    <a class="accordion-toggle collapsed existing-queue-name" data-toggle="collapse"
+                       data-parent="#accordion" href="#collapse-{{$index}}">{{ $queue->queueName }}</a>
+
+                    <div class="pull-right col-md-1">
+                        <span class="glyphicon glyphicon-trash delete-queue" style="cursor:pointer;" data-toggle="modal"
+                              data-target="#delete-queue" data-queue-name="{{ $queue->queueName }}"></span>
+                    </div>
+                </h4>
             </div>
-            <div class="form-group addedScpValue hide">
-				<label class="control-label">SSH Port</label>
-                <input class='form-control' name='sshPort'/>
+            <div id="collapse-{{$index}}" class="panel-collapse collapse">
+                <div class="panel-body">
+                    <form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
+                        <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+
+                        <div class="queue">
+                            <input type="hidden" name="cr-edit" value="queue"/>
+
+                            <div class="form-group required">
+                                <label class="control-label">Queue Name
+                                    <small> ( cannot be changed.)</small>
+                                </label>
+                                <input class="form-control" value="{{ $queue->queueName }}" maxlength="30" name="qname"
+                                       placeholder="Queue Name" readonly/>
+                            </div>
+                            @include('partials/queue-block', array('queueData'=>$queue))
+                            <div class="form-group">
+                                <input type="submit" min="0" class="btn" name="step1" value="Update"/>
+                            </div>
+                        </div>
+                    </form>
+                </div>
             </div>
-		</div>
-
-		<div class="cloud-block hide">
-			<div class="form-group">
-				<label class="control-label">Node Id</label>
-				<input class="form-control" name="nodeId" placeholder="nodId"/>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Node Id</label>
-				<input class="form-control" name="nodeId" placeholder="nodId"/>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Executable Type</label>
-				<input class="form-control" name="nodeId" placeholder="executableType"/>
-			</div>
-			<div class="form-group">
-			<label class="control-label">Select Provider Name</label>
-			<select class="form-control">
-				<option name="EC2">EC2</option>
-				<option name="AWSEC2">AWEC2</option>
-				<option name="RACKSPACE">RACKSPACE</option>
-			</select>
-			</div>
-		</div>
-
-		<div class="dm-gridftp hide">
-			<div class="form-group required">
-				<label class="control-label">Grid FTP End Points</label>
-				<input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required/>
-				<button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP End Points</button>
-			</div>
-		</div>
-
-		<!-- 
-		<div class="form-group">
-			<input type="submit" class="btn  btn-primary" name="step2" value="Continue"/>
-			<input type="reset" class="btn  btn-success" value="Reset"/>
-		</div>
-
-		--> 
-	</div>
+        </div>
+        @endforeach
+    </div>
+    @endif
+    <div class="queue-block hide">
+        <form role="form" method="POST" action="{{ URL::to('/')}}/cr/edit">
+            <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+
+            <div class="queue">
+                <div class="queue">
+                    <input type="hidden" name="cr-edit" value="queue"/>
+
+                    <div class="form-group required">
+                        <label class="control-label">Queue Name
+                            <small> ( A queue name is unique and cannot be changed later.)</small>
+                        </label>
+                        <input class="form-control create-queue-name" maxlength="30" name="qname"
+                               placeholder="Queue Name" required="required"/>
+                    </div>
+                    @include('partials/queue-block')
+
+                </div>
+                <div class="form-group">
+                    <input type="button" class="btn create-queue-form btn-primary" name="step1" value="Create"/>
+                    <input type="reset" class="btn  btn-success" value="Reset"/>
+                </div>
+            </div>
+        </form>
+    </div>
+    <div class="form-group well add-queue-block">
+        <button type="button" class="btn btn-sm btn-default add-queue">Add a Queue</button>
+    </div>
+
 </div>
 
-<!-- modals -->
+<div class="tab-pane" id="tab-filesystem">
 
-<div class="modal fade" id="confirm-delete-jsi" tabindex="-1" role="dialog" aria-labelledby="delete-modal" aria-hidden="true">
-    <div class="modal-dialog">
-        <div class="modal-content">
-        <form action="{{ URL::to('cr/delete-jsi') }}" method="POST">
-			<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-    		<input type="hidden" name="jsiId" value="" class="delete-jsi-confirm"/>
-            <div class="modal-header">
-                Confirmation
+    <form role="form" method="POST" action="{{URL::to('/')}}/cr/edit">
+        <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+        <input type="hidden" name="cr-edit" value="fileSystems"/>
+
+        <div class="form-group">
+            <h3>FileSystem</h3>
+            @foreach( $fileSystems as $index => $fileSystem)
+            <label class="control-label">{{ $fileSystem }}</label>
+            <input class="form-control" name="fileSystems[{{ $index }}]" placeholder="{{ $fileSystem }}"
+                   value="@if( isset( $computeResource->fileSystems[ $index]) ){{ $computeResource->fileSystems[ $index] }} @endif"/>
+            @endforeach
+            </select>
+        </div>
+        <div class="form-group">
+            <button class="btn btn-prim">Update</button>
+        </div>
+    </form>
+
+</div>
+
+<div class="tab-pane" id="tab-jobSubmission">
+
+    <div class="form-group">
+        <div class="job-submission-info row hide"></div>
+        <button type="button" class="btn btn-sm btn-default add-job-submission">Add a new Job Submission Interface
+        </button>
+        @if( count( $jobSubmissionInterfaces ) > 1)
+        <button type="button" class="btn btn-sm btn-default update-priority" data-type="jsi" data-toggle="modal"
+                data-target="#update-jsi-priority">Update Priority
+        </button>
+        @endif
+    </div>
+
+    @if( count( $jobSubmissionInterfaces ) )
+    <div class="job-edit-info">
+        @foreach( $jobSubmissionInterfaces as $index => $JSI )
+
+        <div class="job-protocol-block">
+            <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+                <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+                <input type="hidden" name="cr-edit" value="edit-jsp"/>
+                <input type="hidden" name="jsiId" value="{{ $JSI->jobSubmissionInterfaceId }}"/>
+                <?php $selectedJspIndex = $computeResource->jobSubmissionInterfaces[$index]->jobSubmissionProtocol; ?>
+
+                <h4>Job Submission Protocol : {{ $jobSubmissionProtocols[ $selectedJspIndex] }}
+                    <button type='button' class='close delete-jsi' data-toggle="modal" data-target="#confirm-delete-jsi"
+                            data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}">
+                        <span class="glyphicon glyphicon-trash delete-jsi" data-toggle="modal"
+                              data-target="#confirm-delete-jsi"
+                              data-jsi-id="{{ $JSI->jobSubmissionInterfaceId }}"></span>
+                    </button>
+                </h4>
+                <input type="hidden" name="jobSubmissionProtocol" value="{{ $selectedJspIndex }}"/>
+                @if( $selectedJspIndex == $jobSubmissionProtocolsObject::LOCAL)
+                <div class="select-resource-manager-type">
+                    <div class="form-group required">
+                        <label class="control-label">Select resource manager type</label>
+                        <select name="resourceJobManagerType" class="form-control selected-resource-manager"
+                                required="required">
+                            @foreach( $resourceJobManagerTypes as $index => $rJmT)
+                            <option value="{{ $index }}"
+                            @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{ $rJmT
+                            }}</option>
+                            @endforeach
+                        </select>
+                    </div>
+                    <div class="form-group">
+                        <label class="control-label">Push Monitoring End Point</label>
+                        <input type="text" class="form-control" name="pushMonitoringEndpoint"
+                               value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
+                    </div>
+                    <div class="form-group">
+                        <label class="control-label">Job Manager Bin Path</label>
+                        <input type="text" class="form-control" name="jobManagerBinPath"
+                               value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
+                    </div>
+                    <div class="form-group">
+                        <h3>Job Manager Commands</h3>
+                        @foreach( $jobManagerCommands as $index => $jmc)
+                        <label class="control-label">{{ $jmc }}</label>
+                        <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"
+                               value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
+                        @endforeach
+                        </select>
+                    </div>
+                </div>
+                @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::SSH)
+                <div class="form-group required">
+                    <label class="control-label">Select Security Protocol</label>
+                    <select name="securityProtocol" required="required">
+                        @foreach( $securityProtocols as $index => $sp)
+                        <option value="{{ $index }}"
+                        @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+                        @endforeach
+                    </select>
+                </div>
+
+                <div class="form-group">
+                    <label class="control-label">Alternate SSH Host Name</label>
+                    <input class='form-control' name='alternativeSSHHostName'
+                           value="{{ $JSI->alternativeSSHHostName}}"/>
+                </div>
+                <div class="form-group">
+                    <label class="control-label">SSH Port</label>
+                    <input class='form-control' name='sshPort' value="{{ $JSI->sshPort }}"/>
+                </div>
+
+                <div class="form-group required">
+                    <label class="control-label">Select Monitoring Mode</label>
+                    <select name="monitorMode" required>
+                        @foreach( $monitorModes as $index => $mode)
+                        <option value="{{ $index }}"
+                        @if( $JSI->monitorMode == $index ) selected @endif>{{ $mode}}</option>
+                        @endforeach
+                    </select>
+                </div>
+
+                <div class="form-group">
+                    <div class="select-resource-manager-type">
+                        <div class="form-group required">
+                            <label class="control-label">Select resource manager type</label>
+                            <select name="resourceJobManagerType" class="form-control selected-resource-manager"
+                                    required="required">
+                                @foreach( $resourceJobManagerTypes as $index => $rJmT)
+                                <option value="{{ $index }}"
+                                @if( $JSI->resourceJobManager->resourceJobManagerType == $index ) selected @endif >{{
+                                $rJmT }}</option>
+                                @endforeach
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label">Push Monitoring End Point</label>
+                            <input type="text" class="form-control" name="pushMonitoringEndpoint"
+                                   value="{{ $JSI->resourceJobManager->pushMonitoringEndpoint }}"/>
+                        </div>
+                        <div class="form-group">
+                            <label class="control-label">Job Manager Bin Path</label>
+                            <input type="text" class="form-control" name="jobManagerBinPath"
+                                   value="{{ $JSI->resourceJobManager->jobManagerBinPath }}"/>
+                        </div>
+                        <div class="form-group">
+                            <h3>Job Manager Commands</h3>
+                            @foreach( $jobManagerCommands as $index => $jmc)
+                            <label class="control-label">{{ $jmc }}</label>
+                            <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"
+                                   value="@if( isset( $JSI->resourceJobManager->jobManagerCommands[$index] ) ) {{ $JSI->resourceJobManager->jobManagerCommands[$index] }} @endif"/>
+                            @endforeach
+                        </div>
+                    </div>
+                </div>
+
+                @elseif( $selectedJspIndex == $jobSubmissionProtocolsObject::UNICORE)
+                <div class="form-group required">
+                    <label class="control-label">Select Security Protocol</label>
+                    <select name="securityProtocol" required="required">
+                        @foreach( $securityProtocols as $index => $sp)
+                        <option value="{{ $index }}"
+                        @if( $JSI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+                        @endforeach
+                    </select>
+                </div>
+                <div class="form-group">
+                    <label class="form-label">Unicore End Point URL</label>
+                    <input class='form-control' name='unicoreEndPointURL' value="{{ $JSI->unicoreEndPointURL }}"/>
+                </div>
+                @endif
+                <div class="form-group">
+                    <button type="submit" class="btn">Update</button>
+                </div>
+            </form>
+
+        </div>
+        @endforeach
+    </div>
+    @endif
+
+    <div class="select-job-protocol hide">
+        <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+            <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+            <input type="hidden" name="cr-edit" value="jsp"/>
+
+            <div class="form-group">
+                <label class="control-label">Job Submission Protocol:</label>
+                <select name="jobSubmissionProtocol" class="form-control selected-job-protocol" required="required">
+                    <option></option>
+                    @foreach( $jobSubmissionProtocols as $index => $jobSubmissionProtocol)
+                    @if( ! in_array( $index, $addedJSP))
+                    <option value="{{ $index }}">{{ $jobSubmissionProtocol }}</option>
+                    @endif
+                    @endforeach
+                </select>
             </div>
-            <div class="modal-body">
-                Do you really want to delete this Job Submission Interface ?
+
+            <div class="form-group">
+                <button type="submit" class="btn btn-primary jspSubmit hide">Add Job Submission Protocol</button>
             </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
-                <button type="submit" class="btn btn-danger danger">Delete</button>
+        </form>
+    </div>
+
+</div>
+
+<div class="tab-pane" id="tab-dataMovement">
+
+    <div class="form-group">
+        <div class="data-movement-info row hide"></div>
+        <button type="button" class="btn btn-sm btn-default add-data-movement">Add a new Data Movement Interface
+        </button>
+        @if( count( $dataMovementInterfaces ) > 1)
+        <button type="button" class="btn btn-sm btn-default update-priority" data-type="dmi" data-toggle="modal"
+                data-target="#update-dmi-priority">Update Priority
+        </button>
+        @endif
+    </div>
+
+    @if( count( $dataMovementInterfaces ) )
+    <div class="job-edit-info">
+        @foreach( $dataMovementInterfaces as $index => $DMI )
+        <div class="data-movement-block">
+            <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+                <input type="hidden" name="crId" class="crId" value="{{Input::get('crId') }}"/>
+                <input type="hidden" name="cr-edit" value="edit-dmi"/>
+                <input type="hidden" name="dmiId" value="{{ $DMI->dataMovementInterfaceId }}"/>
+
+                <?php $selectedDMIIndex = $computeResource->dataMovementInterfaces[$index]->dataMovementProtocol; ?>
+
+                <h4>Data Movement Protocol : {{ $dataMovementProtocols[ $selectedDMIIndex] }}
+                    <button type='button' class='close delete-dmi' data-toggle="modal" data-target="#confirm-delete-dmi"
+                            data-dmi-id="{{ $DMI->dataMovementInterfaceId }}">
+                        <span class="glyphicon glyphicon-trash delete-dmi" data-toggle="modal"
+                              data-target="#confirm-delete-dmi"
+                              data-dmi-id="{{ $DMI->dataMovementInterfaceId }}"></span>
+                    </button>
+                </h4>
+                <input type="hidden" name="dataMovementProtocol" value="{{ $selectedDMIIndex }}"/>
+                @if( $selectedDMIIndex == $dataMovementProtocolsObject::LOCAL)
+                <!-- Nothing here on local UI -->
+                @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::SCP)
+                <div class="form-group">
+                    <label class="control-label">Select Security Protocol</label>
+                    <select name="securityProtocol">
+                        @foreach( $securityProtocols as $index => $sp)
+                        <option value="{{ $index }}"
+                        @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+                        @endforeach
+                    </select>
+                </div>
+
+                <div class="form-group">
+                    <label class="control-label">Alternate SSH Host Name</label>
+                    <input class='form-control' name='alternativeSSHHostName'
+                           value="{{ $DMI->alternativeSCPHostName }}"/>
+                </div>
+                <div class="form-group">
+                    <label class="control-label">SSH Port</label>
+                    <input class='form-control' name='sshPort' value="{{ $DMI->sshPort }}"/>
+                </div>
+                <div class="form-group">
+                    <button type="submit" class="btn">Update</button>
+                </div>
+                @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::GridFTP)
+                <div class="form-group">
+                    <label class="control-label">Select Security Protocol</label>
+                    <select name="securityProtocol">
+                        @foreach( $securityProtocols as $index => $sp)
+                        <option value="{{ $index }}"
+                        @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+                        @endforeach
+                    </select>
+
+                    <div>
+                        <div class="form-group required">
+                            <label class="control-label">Grid FTP End Points</label>
+                            @foreach( $DMI->gridFTPEndPoints as $endPoint)
+                            <input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required="required"
+                                   value="{{$endPoint}}"/>
+                            @endforeach
+                            <button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP
+                                End Points
+                            </button>
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <button type="submit" class="btn">Update</button>
+                    </div>
+                </div>
+                @elseif( $selectedDMIIndex == $dataMovementProtocolsObject::UNICORE_STORAGE_SERVICE)
+                <div class="form-group">
+                    <label class="control-label">Select Security Protocol</label>
+                    <select name="securityProtocol">
+                        @foreach( $securityProtocols as $index => $sp)
+                        <option value="{{ $index }}"
+                        @if( $DMI->securityProtocol == $index ) selected @endif>{{ $sp }}</option>
+                        @endforeach
+                    </select>
+
+                    <div>
+                        <div class="form-group required">
+                            <label class="control-label">Unicore End Point URL</label>
+                            <input class="form-control" maxlength="30" name="unicoreEndPointURL" required="required"
+                                   value="{{ $DMI->unicoreEndPointURL }}"/>
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <button type="submit" class="btn">Update</button>
+                    </div>
+                </div>
+                @endif
+            </form>
+        </div>
+        @endforeach
+    </div>
+    @endif
+    <div class="select-data-movement hide">
+
+        <form role="form" method="POST" action="{{ URL::to('/') }}/cr/edit">
+            <input type="hidden" name="crId" class="crId" value="{{Input::get('crId') }}"/>
+            <input type="hidden" name="cr-edit" value="dmp"/>
+            <h4>
+                Select the Data Movement Protocol
+            </h4>
+
+            <select name="dataMovementProtocol" class="form-control selected-data-movement-protocol">
+                <option></option>
+                @foreach( $dataMovementProtocols as $index => $dmp)
+                @if( ! in_array( $index, $addedDMI))
+                <option value="{{ $index }}">{{ $dmp }}</option>
+                @endif
+                @endforeach
+            </select>
+
+            <div class="form-group">
+                <button type="submit" class="btn btn-primary dmpSubmit hide">Add Data Movement Protocol</button>
             </div>
+
         </form>
 
+    </div>
+
+</div>
+
+
+</div>
+
+
+<div class="resource-manager-block hide">
+    <div class="select-resource-manager-type">
+        <div class="form-group required">
+            <label class="control-label">Select resource manager type</label>
+            <select name="resourceJobManagerType" class="form-control selected-resource-manager" required="required">
+                @foreach( $resourceJobManagerTypes as $index => $rJmT)
+                <option value="{{ $index }}">{{ $rJmT }}</option>
+                @endforeach
+            </select>
         </div>
     </div>
+    <div class="form-group">
+        <label class="control-label">Push Monitoring End Point</label>
+        <input type="text" class="form-control" name="pushMonitoringEndpoint"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Job Manager Bin Path</label>
+        <input type="text" class="form-control" name="jobManagerBinPath"/>
+    </div>
+    <div class="form-group">
+        <h3>Job Manager Commands</h3>
+        @foreach( $jobManagerCommands as $index => $jmc)
+        <label class="control-label">{{ $jmc }}</label>
+        <input class="form-control" name="jobManagerCommands[{{ $index }}]" placeholder="{{ $jmc }}"/>
+        @endforeach
+        </select>
+    </div>
+</div>
+
+<div class="ssh-block hide">
+    <div class="form-group required">
+        <label class="control-label">Select Security Protocol </label>
+        <select name="securityProtocol" required>
+            @foreach( $securityProtocols as $index => $sp)
+            <option value="{{ $index }}">{{ $sp }}</option>
+            @endforeach
+        </select>
+    </div>
+
+    <div class="form-group required">
+        <label class="control-label">Select Monitoring Mode </label>
+        <select name="monitorMode" required>
+            @foreach( $monitorModes as $index => $mode)
+            <option value="{{ $index }}">{{ $mode}}</option>
+            @endforeach
+        </select>
+    </div>
+
+    <div class="form-group addedScpValue hide">
+        <label class="control-label">Alternate SSH Host Name</label>
+        <input class='form-control' name='alternativeSSHHostName'/>
+    </div>
+    <div class="form-group addedScpValue hide">
+        <label class="control-label">SSH Port</label>
+        <input class='form-control' name='sshPort'/>
+    </div>
+</div>
+
+<div class="cloud-block hide">
+    <div class="form-group">
+        <label class="control-label">Node Id</label>
+        <input class="form-control" name="nodeId" placeholder="nodId"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Node Id</label>
+        <input class="form-control" name="nodeId" placeholder="nodId"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Executable Type</label>
+        <input class="form-control" name="nodeId" placeholder="executableType"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Select Provider Name</label>
+        <select class="form-control">
+            <option name="EC2">EC2</option>
+            <option name="AWSEC2">AWEC2</option>
+            <option name="RACKSPACE">RACKSPACE</option>
+        </select>
+    </div>
+</div>
+
+<div class="dm-gridftp hide">
+    <div class="form-group required">
+        <label class="control-label">Grid FTP End Points</label>
+        <input class="form-control" maxlength="30" name="gridFTPEndPoints[]" required/>
+        <button type="button" class="btn btn-sm btn-default add-gridFTPEndPoint">Add More Grid FTP End Points</button>
+    </div>
+</div>
+
+<!--
+<div class="form-group">
+    <input type="submit" class="btn  btn-primary" name="step2" value="Continue"/>
+    <input type="reset" class="btn  btn-success" value="Reset"/>
 </div>
 
-<div class="modal fade" id="confirm-delete-dmi" tabindex="-1" role="dialog" aria-labelledby="delete-modal" aria-hidden="true">
+-->
+</div>
+</div>
+
+<!-- modals -->
+
+<div class="modal fade" id="confirm-delete-jsi" tabindex="-1" role="dialog" aria-labelledby="delete-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
         <div class="modal-content">
-        <form action="{{ URL::to('cr/delete-jsi') }}" method="POST">
-			<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-    		<input type="hidden" name="dmiId" value="" class="delete-dmi-confirm"/>
-            <div class="modal-header">
-                Confirmation
-            </div>
-            <div class="modal-body">
-                Do you really want to delete this Data Movement Interface ?
-            </div>
-            <div class="modal-footer">
-                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
-                <button type="submit" class="btn btn-danger danger">Delete</button>
-            </div>
+            <form action="{{ URL::to('cr/delete-jsi') }}" method="POST">
+                <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+                <input type="hidden" name="jsiId" value="" class="delete-jsi-confirm"/>
+
+                <div class="modal-header">
+                    Confirmation
+                </div>
+                <div class="modal-body">
+                    Do you really want to delete this Job Submission Interface ?
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+                    <button type="submit" class="btn btn-danger danger">Delete</button>
+                </div>
+            </form>
+
+        </div>
+    </div>
+</div>
+
+<div class="modal fade" id="confirm-delete-dmi" tabindex="-1" role="dialog" aria-labelledby="delete-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <form action="{{ URL::to('cr/delete-jsi') }}" method="POST">
+                <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+                <input type="hidden" name="dmiId" value="" class="delete-dmi-confirm"/>
+
+                <div class="modal-header">
+                    Confirmation
+                </div>
+                <div class="modal-body">
+                    Do you really want to delete this Data Movement Interface ?
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+                    <button type="submit" class="btn btn-danger danger">Delete</button>
+                </div>
         </div>
     </div>
 </div>
@@ -599,44 +661,49 @@
                 Add a Job Submission Interface
             </div>
             <div class="modal-body add-jsi-body row">
-               
+
             </div>
         </div>
     </div>
 </div>
 
 @if( count( $jobSubmissionInterfaces ) > 1)
-<div class="modal fade" id="update-jsi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="update-jsi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
         <div class="modal-content">
             <div class="modal-header">
-               Update the Priority Order
+                Update the Priority Order
             </div>
             <div class="modal-body">
-            	<!-- dirty hack to avoid some code that removes the form tag below this. Needs better fix. -->
-            	<form></form>
-
-            	<form action="{{URL::to('/')}}/cr/edit" method="POST" id="jsi-priority-form"> 
-					<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-	            	<input type="hidden" name="cr-edit" value="jsi-priority"/>
-	        		@foreach( $computeResource->jobSubmissionInterfaces as $index => $JSI )
-	            	<div class="row">
-	    				<div class="col-md-offset-2 col-md-2">
-	        				<label>
-	        					{{ $jobSubmissionProtocols[ $JSI->jobSubmissionProtocol] }}
-	        				</label>
-	        			</div>
-	    				<input type="hidden" name="jsi-id[]" maxlength="2" value="{{ $JSI->jobSubmissionInterfaceId }}"/>
-	    				<div class="col-md-4">
-	        				<input type="number" name="jsi-priority[]" min="0" max="{{ count( $jobSubmissionInterfaces) }}" value="{{ $JSI->priorityOrder }}" required/>
-						</div>
-	        		</div>
-	        		@endforeach
-	        		<button type="submit" class="btn btn-update">Update</button>
-	        		<div class='priority-updated alert alert-success hide'>
-	        			The Job Submission Interface Priority has been updated.
-	        		</div>
-        		</form>
+                <!-- dirty hack to avoid some code that removes the form tag below this. Needs better fix. -->
+                <form></form>
+
+                <form action="{{URL::to('/')}}/cr/edit" method="POST" id="jsi-priority-form">
+                    <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+                    <input type="hidden" name="cr-edit" value="jsi-priority"/>
+                    @foreach( $computeResource->jobSubmissionInterfaces as $index => $JSI )
+                    <div class="row">
+                        <div class="col-md-offset-2 col-md-2">
+                            <label>
+                                {{ $jobSubmissionProtocols[ $JSI->jobSubmissionProtocol] }}
+                            </label>
+                        </div>
+                        <input type="hidden" name="jsi-id[]" maxlength="2"
+                               value="{{ $JSI->jobSubmissionInterfaceId }}"/>
+
+                        <div class="col-md-4">
+                            <input type="number" name="jsi-priority[]" min="0"
+                                   max="{{ count( $jobSubmissionInterfaces) }}" value="{{ $JSI->priorityOrder }}"
+                                   required/>
+                        </div>
+                    </div>
+                    @endforeach
+                    <button type="submit" class="btn btn-update">Update</button>
+                    <div class='priority-updated alert alert-success hide'>
+                        The Job Submission Interface Priority has been updated.
+                    </div>
+                </form>
             </div>
         </div>
     </div>
@@ -650,41 +717,44 @@
                 Add a Data Model Interface
             </div>
             <div class="modal-body add-dmi-body row">
-               
+
             </div>
         </div>
     </div>
 </div>
 
 @if( count( $dataMovementInterfaces ) > 1)
-<div class="modal fade" id="update-dmi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="update-dmi-priority" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
         <div class="modal-content">
             <div class="modal-header">
-               Update the Priority Order
+                Update the Priority Order
             </div>
             <div class="modal-body">
-            	<form action="{{URL::to('/')}}/cr/edit" method="POST" id="dmi-priority-form"> 
-					<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
-	            	<input type="hidden" name="cr-edit" value="dmi-priority"/>
-	        		@foreach( $computeResource->dataMovementInterfaces as $index => $DMI )
-	            	<div class="row">
-	    				<div class="col-md-offset-2 col-md-2">
-	        				<label>
-	        					{{ $dataMovementProtocols[ $DMI->dataMovementProtocol] }}
-	        				</label>
-	        			</div>
-	    				<input type="hidden" name="dmi-id[]" maxlength="2" value="{{ $DMI->dataMovementInterfaceId }}"/>
-	    				<div class="col-md-4">
-	        				<input type="number" min="0" name="dmi-priority[]" value="{{ $DMI->priorityOrder }}" required/>
-						</div>
-	        		</div>
-	        		@endforeach
-	        		<button type="submit" class="btn btn-update">Update</button>
-	        		<div class='priority-updated alert alert-success hide'>
-	        			The Data Movement Interface Priority has been updated.
-	        		</div>
-        		</form>
+                <form action="{{URL::to('/')}}/cr/edit" method="POST" id="dmi-priority-form">
+                    <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+                    <input type="hidden" name="cr-edit" value="dmi-priority"/>
+                    @foreach( $computeResource->dataMovementInterfaces as $index => $DMI )
+                    <div class="row">
+                        <div class="col-md-offset-2 col-md-2">
+                            <label>
+                                {{ $dataMovementProtocols[ $DMI->dataMovementProtocol] }}
+                            </label>
+                        </div>
+                        <input type="hidden" name="dmi-id[]" maxlength="2" value="{{ $DMI->dataMovementInterfaceId }}"/>
+
+                        <div class="col-md-4">
+                            <input type="number" min="0" name="dmi-priority[]" value="{{ $DMI->priorityOrder }}"
+                                   required/>
+                        </div>
+                    </div>
+                    @endforeach
+                    <button type="submit" class="btn btn-update">Update</button>
+                    <div class='priority-updated alert alert-success hide'>
+                        The Data Movement Interface Priority has been updated.
+                    </div>
+                </form>
             </div>
         </div>
     </div>
@@ -695,36 +765,37 @@
 <div class="modal fade" id="delete-queue" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
     <div class="modal-dialog">
         <div class="modal-content">
-   			<!-- dirty hack to neutralise form problem in code by just adding an empty form tag before the actual form. Needs fix.-->
-        	<form></form>
-        	<form action="{{URL::to('/')}}/cr/edit" method="POST"/> 	
-				<input type="hidden" name="crId" value="{{Input::get('crId') }}"/>    
-				<input type="hidden" name="cr-edit" value="delete-queue"/>
-				<input type="hidden" name="queueName" class="delete-queueName" value=""/>
-	            <div class="modal-header">
-	               Confirmation to Delete Queue
-	            </div>
-	            <div class="modal-body">
-						Do you really want to delete the Batch Queue - <span class="delete-queueName"></span>?
-	            </div>
-	            <div class="modal-footer">
-	            	<button type="submit" class="btn btn-danger">Delete</button>
-	            	<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
-	            </div>
-	        </form>
+            <!-- dirty hack to neutralise form problem in code by just adding an empty form tag before the actual form. Needs fix.-->
+            <form></form>
+            <form action="{{URL::to('/')}}/cr/edit" method="POST"/>
+            <input type="hidden" name="crId" value="{{Input::get('crId') }}"/>
+            <input type="hidden" name="cr-edit" value="delete-queue"/>
+            <input type="hidden" name="queueName" class="delete-queueName" value=""/>
+
+            <div class="modal-header">
+                Confirmation to Delete Queue
+            </div>
+            <div class="modal-body">
+                Do you really want to delete the Batch Queue - <span class="delete-queueName"></span>?
+            </div>
+            <div class="modal-footer">
+                <button type="submit" class="btn btn-danger">Delete</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
+            </div>
+            </form>
         </div>
     </div>
 </div>
 @stop
 
 @section('scripts')
-	@parent
-    {{ HTML::script('js/script.js') }}
-
-    <script type="text/javascript">
-    	$(".delete-queue").click( function(){
-    		$(".delete-queueName").val( $(this).data("queue-name") );
-    		$(".delete-queueName").html( $(this).data("queue-name") );
-    	})
-    </script>
+@parent
+{{ HTML::script('js/script.js') }}
+
+<script type="text/javascript">
+    $(".delete-queue").click(function () {
+        $(".delete-queueName").val($(this).data("queue-name"));
+        $(".delete-queueName").html($(this).data("queue-name"));
+    })
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/resource/view.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/view.blade.php b/app/views/resource/view.blade.php
deleted file mode 100644
index e69de29..0000000

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/scigap-admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/scigap-admin/manage-gateway.blade.php b/app/views/scigap-admin/manage-gateway.blade.php
index 288e122..a07c329 100644
--- a/app/views/scigap-admin/manage-gateway.blade.php
+++ b/app/views/scigap-admin/manage-gateway.blade.php
@@ -1,116 +1,124 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}
+@parent
+{{ HTML::style('css/admin.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-            @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-            <div class="col-md-12">
+<div id="wrapper">
+    <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+    @include( 'partials/dashboard-block')
+    <div id="page-wrapper">
+        <div class="col-md-12">
             @if( Session::has("message"))
-                <div class="row">
-                    <div class="alert alert-success alert-dismissible" role="alert">
-                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                        {{ Session::get("message") }}
-                    </div>
+            <div class="row">
+                <div class="alert alert-success alert-dismissible" role="alert">
+                    <button type="button" class="close" data-dismiss="alert"><span
+                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+                    {{ Session::get("message") }}
                 </div>
-                {{ Session::forget("message") }}
-            @endif
             </div>
-            <div class="container-fluid">
+            {{ Session::forget("message") }}
+            @endif
+        </div>
+        <div class="container-fluid">
 
-                    <div class="row">
+            <div class="row">
 
-                        <div class="col-md-6">
-                            <h3>Existing Gateways :</h3>
-                        </div>
-                        <div class="col-md-6" style="margin-top:3.5%">
-                            <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name" />
+                <div class="col-md-6">
+                    <h3>Existing Gateways :</h3>
+                </div>
+                <div class="col-md-6" style="margin-top:3.5%">
+                    <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name"/>
+                </div>
+            </div>
+            <table class="table table-bordered">
+                <tr>
+                    <th>No.</th>
+                    <th>Gateway</th>
+                    <th>Admin ( Not implemented yet.)</th>
+                    <th>Actions</th>
+                </tr>
+                @foreach( $gateways as $indexGP => $gp)
+                <tr>
+                    <td>{{ $indexGP }}</td>
+                    <td>{{ $gp->gatewayName }}</td>
+                    <td>--</td>
+                    <td>
+                        <div class="gateway-options">
+                            <span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#edit-gateway-block"
+                                  data-gp-id="{{ $gp->gatewayId }}" data-gp-name="{{ $gp->gatewayName }}"></span>
+                            <span class="glyphicon glyphicon-trash delete-gateway" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#delete-gateway-block"
+                                  data-gp-name="{{$gp->gatewayName}}" data-gp-id="{{ $gp->gatewayId }}"></span>
                         </div>
+                    </td>
+                </tr>
+                @endforeach
+            </table>
+            <form id="add-tenant-form">
+                <div class="col-md-12">
+                    <button type="button" class="btn btn-default toggle-add-tenant"><span
+                            class="glyphicon glyphicon-plus"></span>Add a new gateway
+                    </button>
+                </div>
+                <div class="add-tenant col-md-6">
+                    <div class="form-group required">
+                        <label class="control-label">Enter Domain Name</label>
+                        <input type="text" name="domain" class="form-control" required="required"/>
                     </div>
-                    <table class="table table-bordered">
-                        <tr>
-                            <th>No.</th>
-                            <th>Gateway</th>
-                            <th>Admin ( Not implemented yet.)</th>
-                            <th>Actions</th>
-                        </tr>
-                        @foreach( $gateways as $indexGP => $gp)
-                        <tr>
-                            <td>{{ $indexGP }}</td>
-                            <td>{{ $gp->gatewayName }}</td>
-                            <td>--</td>
-                            <td>
-                                <div class="gateway-options">
-                                    <span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#edit-gateway-block" data-gp-id="{{ $gp->gatewayId }}" data-gp-name="{{ $gp->gatewayName }}"></span>
-                                    <span class="glyphicon glyphicon-trash delete-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#delete-gateway-block" data-gp-name="{{$gp->gatewayName}}" data-gp-id="{{ $gp->gatewayId }}"></span>
-                                </div>
-                            </td>
-                        </tr>
-                        @endforeach
-                    </table>
-                <form id="add-tenant-form">
-                    <div class="col-md-12">
-                        <button type="button" class="btn btn-default toggle-add-tenant"><span class="glyphicon glyphicon-plus"></span>Add a new gateway</button>
+                    <div class="form-group required">
+                        <label class="control-label">Enter Desired Gateway Name</label>
+                        <input type="text" name="gatewayName" class="form-control" required="required"/>
                     </div>
-                    <div class="add-tenant col-md-6">
-                        <div class="form-group required">
-                            <label class="control-label">Enter Domain Name</label>
-                            <input type="text" name="domain" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Enter Desired Gateway Name</label>
-                            <input type="text" name="gatewayName" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Enter Admin Email Address</label>
-                            <input type="text" name="admin-email" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Enter Admin First Name</label>
-                            <input type="text" name="admin-firstname" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Enter Admin Last Name</label>
-                            <input type="text" name="admin-lastname" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Enter Admin Username</label>
-                            <input type="text" name="admin-username" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Enter Admin Password</label>
-                            <input type="password" name="admin-password" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <label class="control-label">Re-enter Admin Password</label>
-                            <input type="password" name="admin-password-confirm" class="form-control" required="required"/>
-                        </div>
-                        <div class="form-group required">
-                            <input type="submit" class="col-md-2 form-control btn btn-primary" value="Register" />
-                        </div>
+                    <div class="form-group required">
+                        <label class="control-label">Enter Admin Email Address</label>
+                        <input type="text" name="admin-email" class="form-control" required="required"/>
                     </div>
-                    <div class="col-md-6 alert alert-danger gateway-error hide">
+                    <div class="form-group required">
+                        <label class="control-label">Enter Admin First Name</label>
+                        <input type="text" name="admin-firstname" class="form-control" required="required"/>
                     </div>
-                </form>
-            </div>
-            <!-- /.container-fluid -->
-
+                    <div class="form-group required">
+                        <label class="control-label">Enter Admin Last Name</label>
+                        <input type="text" name="admin-lastname" class="form-control" required="required"/>
+                    </div>
+                    <div class="form-group required">
+                        <label class="control-label">Enter Admin Username</label>
+                        <input type="text" name="admin-username" class="form-control" required="required"/>
+                    </div>
+                    <div class="form-group required">
+                        <label class="control-label">Enter Admin Password</label>
+                        <input type="password" name="admin-password" class="form-control" required="required"/>
+                    </div>
+                    <div class="form-group required">
+                        <label class="control-label">Re-enter Admin Password</label>
+                        <input type="password" name="admin-password-confirm" class="form-control" required="required"/>
+                    </div>
+                    <div class="form-group required">
+                        <input type="submit" class="col-md-2 form-control btn btn-primary" value="Register"/>
+                    </div>
+                </div>
+                <div class="col-md-6 alert alert-danger gateway-error hide">
+                </div>
+            </form>
         </div>
-        <!-- /#page-wrapper -->
+        <!-- /.container-fluid -->
 
     </div>
+    <!-- /#page-wrapper -->
+
+</div>
 
 
 <div class="add-compute-resource-block hide">
     <div class="well">
         <form action="{{URL::to('/')}}/gp/add-crp" method="POST">
             <input type="hidden" name="gatewayId" id="gatewayId" value="">
+
             <div class="input-group">
                 <select name="computeResourceId" class="cr-select form-control">
                     <option value="">Select a compute Resource and set its preferences</option>
@@ -121,14 +129,15 @@
                 <span class="input-group-addon remove-cr" style="cursor:pointer;">x</span>
             </div>
             <div class="pref-space form-horizontal"></div>
-        </form> 
+        </form>
     </div>
 </div>
 
 
 <!-- Remove a Compute Resource from a Gateway -->
-<div class="modal fade" id="add-gateway-loading" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true"  data-backdrop="static">
-    <div class="modal-dialog">
+<div class="modal fade" id="add-gateway-loading" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true" data-backdrop="static">
+<div class="modal-dialog">
 
         <form action="{{URL::to('/')}}/gp/remove-cr" method="POST">
             <div class="modal-content">
@@ -149,34 +158,34 @@
 
 
 @section('scripts')
-    @parent
-    {{ HTML::script('js/gateway.js') }}
-    <script>
-
-        $(".add-tenant").slideUp();
-        
-        $(".toggle-add-tenant").click( function(){
-            $('html, body').animate({
-                scrollTop: $(".toggle-add-tenant").offset().top
-            }, 500);
-            $(".add-tenant").slideDown();
-        });
-
-        $("#add-tenant-form").submit( function( event){
-            event.preventDefault();
-            event.stopPropagation();
-            var formData = $("#add-tenant-form").serialize();
-            $("#add-gateway-loading").modal("show");
-            $.ajax({
-                type: "POST",
-                data: formData,
-                url:  '{{ URL::to('/') }}/admin/add-gateway',
-                success:function( data){
-                    $(".gateway-error").html(data).removeClass("hide");
-                }
-            }).complete( function(){
-                $("#add-gateway-loading").modal("hide");
-            });
+@parent
+{{ HTML::script('js/gateway.js') }}
+<script>
+
+    $(".add-tenant").slideUp();
+
+    $(".toggle-add-tenant").click(function () {
+        $('html, body').animate({
+            scrollTop: $(".toggle-add-tenant").offset().top
+        }, 500);
+        $(".add-tenant").slideDown();
+    });
+
+    $("#add-tenant-form").submit(function (event) {
+        event.preventDefault();
+        event.stopPropagation();
+        var formData = $("#add-tenant-form").serialize();
+        $("#add-gateway-loading").modal("show");
+        $.ajax({
+            type: "POST",
+            data: formData,
+            url: '{{ URL::to(' / ') }}/admin/add-gateway',
+            success: function (data) {
+                $(".gateway-error").html(data).removeClass("hide");
+            }
+        }).complete(function () {
+            $("#add-gateway-loading").modal("hide");
         });
-    </script>
+    });
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/server-down.blade.php
----------------------------------------------------------------------
diff --git a/app/views/server-down.blade.php b/app/views/server-down.blade.php
index 6e901f7..284f1d0 100644
--- a/app/views/server-down.blade.php
+++ b/app/views/server-down.blade.php
@@ -1,16 +1,17 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 
-    <div class="container">
-    	<div class="alert alert-danger">
-    		<p class="text-center">Our servers are down at the moment. Please try after some time. Thank you for your patience.</p>
-    	</div>
+<div class="container">
+    <div class="alert alert-danger">
+        <p class="text-center">Our servers are down at the moment. Please try after some time. Thank you for your
+            patience.</p>
     </div>
+</div>
 
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/composer.json
----------------------------------------------------------------------
diff --git a/composer.json b/composer.json
index 9758a4c..88a580b 100755
--- a/composer.json
+++ b/composer.json
@@ -1,36 +1,35 @@
 {
-	"name": "laravel/laravel",
-	"description": "The Laravel Framework.",
-	"keywords": ["framework", "laravel"],
-	"license": "MIT",
-	"require": {
-		"laravel/framework": "4.2.*",
-		"apache/thrift": "1.0.*@dev"
-	},
-	"autoload": {
-		"classmap": [
-			"app/controllers",
-			"app/models",
-			"app/database/seeds",
-			"app/tests/TestCase.php",
-			"app/libraries"
-		]
-	},
-	"scripts": {
-		"post-install-cmd": [
-			"php artisan clear-compiled",
-			"php artisan optimize"
-		],
-		"post-update-cmd": [
-			"php artisan clear-compiled",
-			"php artisan optimize"
-		],
-		"post-create-project-cmd": [
-			"php artisan key:generate"
-		]
-	},
-	"config": {
-		"preferred-install": "dist"
-	},
-	"minimum-stability": "stable"
+    "name": "laravel/laravel",
+    "description": "The Laravel Framework.",
+    "keywords": ["framework", "laravel"],
+    "license": "MIT",
+    "require": {
+        "laravel/framework": "4.2.*",
+        "apache/thrift": "1.0.*@dev"
+    },
+    "autoload": {
+        "classmap": [
+            "app/controllers",
+            "app/database/seeds",
+            "app/tests/TestCase.php",
+            "app/libraries"
+        ]
+    },
+    "scripts": {
+        "post-install-cmd": [
+            "php artisan clear-compiled",
+            "php artisan optimize"
+        ],
+        "post-update-cmd": [
+            "php artisan clear-compiled",
+            "php artisan optimize"
+        ],
+        "post-create-project-cmd": [
+            "php artisan key:generate"
+        ]
+    },
+    "config": {
+        "preferred-install": "dist"
+    },
+    "minimum-stability": "stable"
 }


[03/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/experiment/search.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/search.blade.php b/app/views/experiment/search.blade.php
index b103bbd..926268e 100755
--- a/app/views/experiment/search.blade.php
+++ b/app/views/experiment/search.blade.php
@@ -1,125 +1,129 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/datetimepicker.css')}}            
+@parent
+{{ HTML::style('css/datetimepicker.css')}}
 
 @stop
 
 @section('content')
 
 <div class="container" style="max-width: 750px;">
-<h1>Search for Experiments</h1>
+    <h1>Search for Experiments</h1>
 
-<form action="{{URL::to('/')}}/experiment/search" method="post" class="form-inline" role="form">
-    <div class="form-group">
-        <label for="search-key">Search by</label>
-        <select class="form-control" name="search-key" id="search-key">
-            <?php
+    <form action="{{URL::to('/')}}/experiment/search" method="post" class="form-inline" role="form">
+        <div class="form-group">
+            <label for="search-key">Search by</label>
+            <select class="form-control" name="search-key" id="search-key">
+                <?php
 
-            // set up options for select input
-            $values = array('experiment-name', 'experiment-description', 'application', 'creation-time');
-            $labels = array('Experiment Name', 'Experiment Description', 'Application', 'Creation Time');
-            $disabled = array('', '', '', '');
+                // set up options for select input
+                $values = array('experiment-name', 'experiment-description', 'application', 'creation-time');
+                $labels = array('Experiment Name', 'Experiment Description', 'Application', 'Creation Time');
+                $disabled = array('', '', '', '');
 
-            Utilities::create_options($values, $labels, $disabled);
+                ExperimentUtilities::create_options($values, $labels, $disabled);
 
-            ?>
-        </select>
-    </div>
+                ?>
+            </select>
+        </div>
 
-    <div class="form-group search-text-block">
-        <label for="search-value">for</label>
-        <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
-               value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
-    </div>
+        <div class="form-group search-text-block">
+            <label for="search-value">for</label>
+            <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
+                   value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
+        </div>
 
-    <select name="status-type" class="form-control select-status">
-        <option value="ALL">Status</option>
-        <?php
-        foreach( $expStates as $index => $state){
-            if(isset($input) && $state == $input["status-type"]){
-                echo '<option value="' . $state .'" selected>' . $state . '</option>';
-            }else{
-                echo '<option value="' . $state .'">' . $state . '</option>';
+        <select name="status-type" class="form-control select-status">
+            <option value="ALL">Status</option>
+            <?php
+            foreach ($expStates as $index => $state) {
+                if (isset($input) && $state == $input["status-type"]) {
+                    echo '<option value="' . $state . '" selected>' . $state . '</option>';
+                } else {
+                    echo '<option value="' . $state . '">' . $state . '</option>';
+                }
             }
-        }
-        ?>
-    </select>
+            ?>
+        </select>
 
-    <div class="container select-dates hide">
-        <div class="col-md-12">
-            Select dates between which you want to search for experiments.
-        </div>
-        <div class="col-sm-8" style="height:75px;">
-           <div class='col-md-6'>
-                <div class="form-group">
-                    <div class='input-group date' id='datetimepicker9'>
-                        <input type='text' class="form-control" placeholder="From Date" name="from-date" value="<?php if (isset($_POST['from-date'])) echo $_POST['from-date'] ?>"/>
+        <div class="container select-dates hide">
+            <div class="col-md-12">
+                Select dates between which you want to search for experiments.
+            </div>
+            <div class="col-sm-8" style="height:75px;">
+                <div class='col-md-6'>
+                    <div class="form-group">
+                        <div class='input-group date' id='datetimepicker9'>
+                            <input type='text' class="form-control" placeholder="From Date" name="from-date"
+                                   value="<?php if (isset($_POST['from-date'])) echo $_POST['from-date'] ?>"/>
                         <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                         </span>
+                        </div>
                     </div>
                 </div>
-            </div>
-            <div class='col-md-6'>
-                <div class="form-group">
-                    <div class='input-group date' id='datetimepicker10'>
-                        <input type='text' class="form-control"  placeholder="To Date" name="to-date" value="<?php if (isset($_POST['to-date'])) echo $_POST['to-date'] ?>"/>
+                <div class='col-md-6'>
+                    <div class="form-group">
+                        <div class='input-group date' id='datetimepicker10'>
+                            <input type='text' class="form-control" placeholder="To Date" name="to-date"
+                                   value="<?php if (isset($_POST['to-date'])) echo $_POST['to-date'] ?>"/>
                         <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
                         </span>
+                        </div>
                     </div>
                 </div>
             </div>
         </div>
-    </div>
 
-    <button name="search" type="submit" class="btn btn-primary pull-right" value="Search"><span class="glyphicon glyphicon-search"></span> Search</button>
-    <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your experiments.</p>
+        <button name="search" type="submit" class="btn btn-primary pull-right" value="Search"><span
+                class="glyphicon glyphicon-search"></span> Search
+        </button>
+        <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your
+            experiments.</p>
 
-    <!-- Pagination Handling -->
-    <?php
-        if(isset( $expContainer))
-        {
-    ?>
-        <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
-            <?php
-            if($pageNo!=1){
-                echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
-            }
-            if(sizeof($expContainer)>0){
-                echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
-            }
+        <!-- Pagination Handling -->
+        <?php
+        if (isset($expContainer)) {
             ?>
-        </div>
-        <div class="pull-left">
-            <?php if (sizeof($expContainer) != 0) echo 'Showing results from ' . strval(($pageNo-1)*$limit + 1)
-                . ' to ' . strval(min($pageNo*$limit, ($pageNo-1)*$limit + sizeof($expContainer))); ?>
+            <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
+                <?php
+                if ($pageNo != 1) {
+                    echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
+                }
+                if (sizeof($expContainer) > 0) {
+                    echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
+                }
+                ?>
             </div>
-        <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
-        <div style="clear: both"></div>
-    <?php
+            <div class="pull-left">
+                <?php if (sizeof($expContainer) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
+                    . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($expContainer))); ?>
+            </div>
+            <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
+            <div style="clear: both"></div>
+        <?php
         }
-    ?>
-</form>
+        ?>
+    </form>
 
 
 
 
-<?php
+    <?php
 
-if (isset( $expContainer))
-{
+    if (isset($expContainer))
+    {
     if (sizeof($expContainer) == 0)
     {
-        if($pageNo==1){
-            Utilities::print_warning_message('No results found. Please try again.');
-        }else{
-            Utilities::print_warning_message('No more results found.');
+        if ($pageNo == 1) {
+            CommonUtilities::print_warning_message('No results found. Please try again.');
+        } else {
+            CommonUtilities::print_warning_message('No more results found.');
         }
     }
     else
     {
-?>
+    ?>
 
     <div id="re" class="table-responsive">
         <table class="table">
@@ -130,94 +134,86 @@ if (isset( $expContainer))
                 <!--<th>Resource</th>-->
                 <th>Creation Time</th>
                 <th>Status</th>
-<!--                    <select class="form-control select-status">-->
-<!--                        <option value="ALL">Status</option>-->
-<!--                    @foreach( $expStates as $index => $state)-->
-<!--                        <option value="{{ $state }}">{{ $state }}</option>-->
-<!--                    @endforeach-->
-<!--                    </select>-->
-<!--                </th>-->
+                <!--                    <select class="form-control select-status">-->
+                <!--                        <option value="ALL">Status</option>-->
+                <!--                    @foreach( $expStates as $index => $state)-->
+                <!--                        <option value="{{ $state }}">{{ $state }}</option>-->
+                <!--                    @endforeach-->
+                <!--                    </select>-->
+                <!--                </th>-->
             </tr>
-    
-
-<?php
-        foreach ($expContainer as $experiment)
-        {
-            $description = $experiment['experiment']->description;
-            if (strlen($description) > 17) // 17 is arbitrary
-            {
-                $description = substr($experiment['experiment']->description, 0, 17) . '<span class="text-muted">...</span>';
-            }
 
-            echo '<tr>';
-            $addEditOption="";
-            if( $experiment['expValue']['editable'])
-                $addEditOption = '<a href="'. URL::to('/') . '/experiment/edit?expId=' . $experiment['experiment']->experimentID . '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>';
-
-            echo '<td>' . $experiment['experiment']->name .  $addEditOption . '</td>';
-
-            echo '<td>' . $experiment['expValue']['applicationInterface']->applicationName . '</td>';
-
-            echo '<td>' . $description . '</td>';
-
-            //echo "<td>$computeResource->hostName</td>";
-            echo '<td class="time" unix-time="' . $experiment['experiment']->creationTime/1000 . '"></td>';
-
-
-            switch ($experiment['expValue']['experimentStatusString'])
-            {
-                case 'CANCELING':
-                case 'CANCELED':
-                case 'UNKNOWN':
-                    $textClass = 'text-warning';
-                    break;
-                case 'FAILED':
-                    $textClass = 'text-danger';
-                    break;
-                case 'COMPLETED':
-                    $textClass = 'text-success';
-                    break;
-                default:
-                    $textClass = 'text-info';
-                    break;
-            }
 
-        ?>
-            <td>
-                <a class="<?php echo $textClass; ?>" href="{{ URL::to('/') }}/experiment/summary?expId=<?php echo $experiment['experiment']->experimentID; ?>">
-                    <?php echo $experiment['expValue']['experimentStatusString']; ?>
-                </a>
-            </td>
+            <?php
+            foreach ($expContainer as $experiment) {
+                $description = $experiment['experiment']->description;
+                if (strlen($description) > 17) // 17 is arbitrary
+                {
+                    $description = substr($experiment['experiment']->description, 0, 17) . '<span class="text-muted">...</span>';
+                }
 
-            </tr>
+                echo '<tr>';
+                $addEditOption = "";
+                if ($experiment['expValue']['editable'])
+                    $addEditOption = '<a href="' . URL::to('/') . '/experiment/edit?expId=' . $experiment['experiment']->experimentID . '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>';
 
-        <?php            
-        }
+                echo '<td>' . $experiment['experiment']->name . $addEditOption . '</td>';
 
-        echo '
-            </table>
-            </div>
-            ';
-    }
+                echo '<td>' . $experiment['expValue']['applicationInterface']->applicationName . '</td>';
+
+                echo '<td>' . $description . '</td>';
+
+                //echo "<td>$computeResource->hostName</td>";
+                echo '<td class="time" unix-time="' . $experiment['experiment']->creationTime / 1000 . '"></td>';
 
 
-}
-?>
+                switch ($experiment['expValue']['experimentStatusString']) {
+                    case 'CANCELING':
+                    case 'CANCELED':
+                    case 'UNKNOWN':
+                        $textClass = 'text-warning';
+                        break;
+                    case 'FAILED':
+                        $textClass = 'text-danger';
+                        break;
+                    case 'COMPLETED':
+                        $textClass = 'text-success';
+                        break;
+                    default:
+                        $textClass = 'text-info';
+                        break;
+                }
+
+                ?>
+                <td>
+                    <a class="<?php echo $textClass; ?>"
+                       href="{{ URL::to('/') }}/experiment/summary?expId=<?php echo $experiment['experiment']->experimentID; ?>">
+                        <?php echo $experiment['expValue']['experimentStatusString']; ?>
+                    </a>
+                </td>
 
+                </tr>
 
+            <?php
+            }
+            }
+            }
+            ?>
+        </table>
+    </div>
 </div>
 
 @stop
 
 @section('scripts')
-    @parent
-    {{ HTML::script('js/time-conversion.js')}}
-    {{ HTML::script('js/moment.js')}}            
-    {{ HTML::script('js/datetimepicker.js')}}            
+@parent
+{{ HTML::script('js/time-conversion.js')}}
+{{ HTML::script('js/moment.js')}}
+{{ HTML::script('js/datetimepicker.js')}}
 
-    <script type="text/javascript">
+<script type="text/javascript">
 
-        $(document).ready( function(){
+    $(document).ready(function () {
 
 //------------------------Commenting Client Side filtering--------------------------------------
 //            /* script to make status select work on the UI side itself. */
@@ -249,57 +245,52 @@ if (isset( $expContainer))
 //                }
 //            });
 
-            /* making datetimepicker work for exp search */
-
-            $('#datetimepicker9').datetimepicker({
-                pick12HourFormat: false
-            });
-            $('#datetimepicker10').datetimepicker({
-                pick12HourFormat: false
-            });
-            $("#datetimepicker9").on("dp.change",function (e) {
-               $('#datetimepicker10').data("DateTimePicker").setMinDate(e.date);
-            });
-            $("#datetimepicker10").on("dp.change",function (e) {
-               $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date);
-            });
-
-            /* selecting creation time */
-            $("#search-key").on("change", function(){
-                if( this.value == "creation-time")
-                {
-                    $(".search-text-block").addClass("hide");
-                    $(".select-dates").removeClass("hide");
-                    $("#search-value").removeAttr("required");
+        /* making datetimepicker work for exp search */
 
-                }
-                else
-                {
-                    $(".search-text-block").removeClass("hide");
-                    $(".select-dates").addClass("hide");
-                    $("#search-value").attr("required");
-                }
-            });
+        $('#datetimepicker9').datetimepicker({
+            pick12HourFormat: false
+        });
+        $('#datetimepicker10').datetimepicker({
+            pick12HourFormat: false
+        });
+        $("#datetimepicker9").on("dp.change", function (e) {
+            $('#datetimepicker10').data("DateTimePicker").setMinDate(e.date);
+        });
+        $("#datetimepicker10").on("dp.change", function (e) {
+            $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date);
+        });
 
-            changeInputVisibility( $("#search-key").val() );
+        /* selecting creation time */
+        $("#search-key").on("change", function () {
+            if (this.value == "creation-time") {
+                $(".search-text-block").addClass("hide");
+                $(".select-dates").removeClass("hide");
+                $("#search-value").removeAttr("required");
 
+            }
+            else {
+                $(".search-text-block").removeClass("hide");
+                $(".select-dates").addClass("hide");
+                $("#search-value").attr("required");
+            }
         });
 
-    function changeInputVisibility( selectedStatus)
-    {
-        if( selectedStatus == "creation-time")
-        {
+        changeInputVisibility($("#search-key").val());
+
+    });
+
+    function changeInputVisibility(selectedStatus) {
+        if (selectedStatus == "creation-time") {
             $(".search-text-block").addClass("hide");
             $(".select-dates").removeClass("hide");
             $("#search-value").removeAttr("required");
 
         }
-        else
-        {
+        else {
             $(".search-text-block").removeClass("hide");
             $(".select-dates").addClass("hide");
             $("#search-value").attr("required");
         }
     }
-    </script>
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/experiment/summary.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/summary.blade.php b/app/views/experiment/summary.blade.php
index b643e8a..845e9ff 100755
--- a/app/views/experiment/summary.blade.php
+++ b/app/views/experiment/summary.blade.php
@@ -1,33 +1,32 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
-    @include('partials/experiment-info')
+@include('partials/experiment-info')
 @stop
 
 
 @section('scripts')
-    @parent
-    <script>
-        var $continue = true;
-        setInterval( function(){
-            if( $.trim( $(".exp-status").html() ) != "COMPLETED" && $continue)
-            {
-                $.ajax({
-                    type:"GET",
-                    url: "{{URL::to('/') }}/experiment/summary",
-                    data: {expId: "{{ Input::get('expId') }}" },
-                    success: function( exp){
-                        if( $.trim( $("#expObj").val() ) != $.trim( exp) ){
-                            $continue = false;
-                            $(".refresh-exp").click();
-                        }
+@parent
+<script>
+    var $continue = true;
+    setInterval(function () {
+        if ($.trim($(".exp-status").html()) != "COMPLETED" && $continue) {
+            $.ajax({
+                type: "GET",
+                url: "{{URL::to('/') }}/experiment/summary",
+                data: {expId: "{{ Input::get('expId') }}" },
+                success: function (exp) {
+                    if ($.trim($("#expObj").val()) != $.trim(exp)) {
+                        $continue = false;
+                        $(".refresh-exp").click();
                     }
-                });
-            }
-        }, 3000);
-    </script>
+                }
+            });
+        }
+    }, 3000);
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/gateway/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/gateway/browse.blade.php b/app/views/gateway/browse.blade.php
index 6d26a06..d7ebf06 100644
--- a/app/views/gateway/browse.blade.php
+++ b/app/views/gateway/browse.blade.php
@@ -1,218 +1,250 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-		<div class="row">
-			<a href="{{URL::to('/')}}/gp/create">
-				<button class="btn btn-default create-gateway-profile">Create a new Gateway Resource Profile</button>
-			</a>
-		</div>
-		@if( count( $gatewayProfiles) )
-			@if( Session::has("message"))
-				<div class="row">
-					<div class="alert alert-success alert-dismissible" role="alert">
-						<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-						{{ Session::get("message") }}
-					</div>
-				</div>
-				{{ Session::forget("message") }}
-			@endif
-			<div class="row">
-
-				<div class="col-md-6">
-					<h3>Existing Gateway Resource Profiles :</h3>
-				</div>
-				<div class="col-md-6" style="margin-top:3.5%">
-					<input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name" />
-				</div>
-			</div>
-			<div class="panel-group" id="accordion1">
-			@foreach( $gatewayProfiles as $indexGP => $gp )
-				<div class="panel panel-default">
-					<div class="panel-heading">
-						<h4 class="panel-title">
-							<a class="accordion-toggle collapsed gateway-name" data-toggle="collapse" data-parent="#accordion" href="#collapse-gateway-{{$indexGP}}">
-							{{ $gp->gatewayName }}
-							</a>
-							<div class="pull-right col-md-2 gateway-options fade">
-								<span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#edit-gateway-block" data-gp-id="{{ $gp->gatewayID }}" data-gp-name="{{ $gp->gatewayName }}" data-gp-desc="{{ $gp->gatewayDescription }}"></span>
-								<span class="glyphicon glyphicon-trash delete-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#delete-gateway-block" data-gp-name="{{$gp->gatewayName}}" data-gp-id="{{ $gp->gatewayID }}"></span>
-							</div>
-						</h4>
-					</div>
-					<div id="collapse-gateway-{{$indexGP}}" class="panel-collapse collapse">
-						<div class="panel-body">
-							<div class="app-interface-block">
-								<h5>{{ $gp->gatewayDescription}}</h5>
-								<hr/>
-								<div class="row">
-									<div class="col-md-10">
-										<button class="btn btn-default add-cr" data-gpid="{{$gp->gatewayID}}"><span class="glyphicon glyphicon-plus"></span> Add a Compute Resource</button>
-									</div>
-								</div>
-								@if( count( $gp->computeResourcePreferences) )
-									<div class="col-md-12">
-										<h3>Existing Compute Resources :</h3>
-									</div>
-									<div class="accordion-inner">
-										<div class="panel-group" id="accordion-{{$indexGP}}">
-										@foreach( (array)$gp->computeResourcePreferences as $indexCRP => $crp )
-											<div class="panel panel-default">
-												<div class="panel-heading">
-													<h4 class="panel-title">
-														<a class="accordion-toggle collapsed gateway-name" data-toggle="collapse" data-parent="#accordion" href="#collapse-crp-{{$indexGP}}-{{$indexCRP}}">
-														{{ $crp->crDetails->hostName }}
-														</a>
-														<div class="pull-right col-md-2 gateway-options fade">
-															<span class="glyphicon glyphicon-remove remove-resource" style="cursor:pointer;" data-toggle="modal" data-target="#remove-resource-block" data-cr-name="{{$crp->crDetails->hostName}}" data-cr-id="{{$crp->computeResourceId}}" data-gp-id="{{ $gp->gatewayID }}"></span>
-														</div>
-													</h4>
-												</div>
-												<div id="collapse-crp-{{$indexGP}}-{{$indexCRP}}" class="panel-collapse collapse">
-													<div class="panel-body">
-														<div class="app-compute-resource-preferences-block">
-															<form action="{{URL::to('/')}}/gp/update-crp" method="POST">
-																<input type="hidden" name="gatewayId" id="gatewayId" value="{{$gp->gatewayID}}">
-																<input type="hidden" name="computeResourceId" id="gatewayId" value="{{$crp->computeResourceId}}">
-																<div class="form-horizontal">
-																	@include('partials/gateway-preferences', array('computeResource' => $crp->crDetails, 'crData' => $crData, 'preferences'=>$crp, 'show'=>true))
-																</div>
-															</form>
-														</div>
-													</div>
-												</div>
-											</div>
-										@endforeach
-										</div>
-									</div>
-								@endif
-							</div>
-						</div>
-					</div>
-				</div>
-			@endforeach
-			</div>
-		@endif
-	</div>
+    <div class="col-md-offset-2 col-md-8">
+        <div class="row">
+            <a href="{{URL::to('/')}}/gp/create">
+                <button class="btn btn-default create-gateway-profile">Create a new Gateway Resource Profile</button>
+            </a>
+        </div>
+        @if( count( $gatewayProfiles) )
+        @if( Session::has("message"))
+        <div class="row">
+            <div class="alert alert-success alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                        class="sr-only">Close</span></button>
+                {{ Session::get("message") }}
+            </div>
+        </div>
+        {{ Session::forget("message") }}
+        @endif
+        <div class="row">
+
+            <div class="col-md-6">
+                <h3>Existing Gateway Resource Profiles :</h3>
+            </div>
+            <div class="col-md-6" style="margin-top:3.5%">
+                <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name"/>
+            </div>
+        </div>
+        <div class="panel-group" id="accordion1">
+            @foreach( $gatewayProfiles as $indexGP => $gp )
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a class="accordion-toggle collapsed gateway-name" data-toggle="collapse"
+                           data-parent="#accordion" href="#collapse-gateway-{{$indexGP}}">
+                            {{ $gp->gatewayName }}
+                        </a>
+
+                        <div class="pull-right col-md-2 gateway-options fade">
+                            <span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#edit-gateway-block"
+                                  data-gp-id="{{ $gp->gatewayID }}" data-gp-name="{{ $gp->gatewayName }}"
+                                  data-gp-desc="{{ $gp->gatewayDescription }}"></span>
+                            <span class="glyphicon glyphicon-trash delete-gateway" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#delete-gateway-block"
+                                  data-gp-name="{{$gp->gatewayName}}" data-gp-id="{{ $gp->gatewayID }}"></span>
+                        </div>
+                    </h4>
+                </div>
+                <div id="collapse-gateway-{{$indexGP}}" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        <div class="app-interface-block">
+                            <h5>{{ $gp->gatewayDescription}}</h5>
+                            <hr/>
+                            <div class="row">
+                                <div class="col-md-10">
+                                    <button class="btn btn-default add-cr" data-gpid="{{$gp->gatewayID}}"><span
+                                            class="glyphicon glyphicon-plus"></span> Add a Compute Resource
+                                    </button>
+                                </div>
+                            </div>
+                            @if( count( $gp->computeResourcePreferences) )
+                            <div class="col-md-12">
+                                <h3>Existing Compute Resources :</h3>
+                            </div>
+                            <div class="accordion-inner">
+                                <div class="panel-group" id="accordion-{{$indexGP}}">
+                                    @foreach( (array)$gp->computeResourcePreferences as $indexCRP => $crp )
+                                    <div class="panel panel-default">
+                                        <div class="panel-heading">
+                                            <h4 class="panel-title">
+                                                <a class="accordion-toggle collapsed gateway-name"
+                                                   data-toggle="collapse" data-parent="#accordion"
+                                                   href="#collapse-crp-{{$indexGP}}-{{$indexCRP}}">
+                                                    {{ $crp->crDetails->hostName }}
+                                                </a>
+
+                                                <div class="pull-right col-md-2 gateway-options fade">
+                                                    <span class="glyphicon glyphicon-remove remove-resource"
+                                                          style="cursor:pointer;" data-toggle="modal"
+                                                          data-target="#remove-resource-block"
+                                                          data-cr-name="{{$crp->crDetails->hostName}}"
+                                                          data-cr-id="{{$crp->computeResourceId}}"
+                                                          data-gp-id="{{ $gp->gatewayID }}"></span>
+                                                </div>
+                                            </h4>
+                                        </div>
+                                        <div id="collapse-crp-{{$indexGP}}-{{$indexCRP}}"
+                                             class="panel-collapse collapse">
+                                            <div class="panel-body">
+                                                <div class="app-compute-resource-preferences-block">
+                                                    <form action="{{URL::to('/')}}/gp/update-crp" method="POST">
+                                                        <input type="hidden" name="gatewayId" id="gatewayId"
+                                                               value="{{$gp->gatewayID}}">
+                                                        <input type="hidden" name="computeResourceId" id="gatewayId"
+                                                               value="{{$crp->computeResourceId}}">
+
+                                                        <div class="form-horizontal">
+                                                            @include('partials/gateway-preferences',
+                                                            array('computeResource' => $crp->crDetails, 'crData' =>
+                                                            $crData, 'preferences'=>$crp, 'show'=>true))
+                                                        </div>
+                                                    </form>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                    @endforeach
+                                </div>
+                            </div>
+                            @endif
+                        </div>
+                    </div>
+                </div>
+            </div>
+            @endforeach
+        </div>
+        @endif
+    </div>
 </div>
 
 <div class="add-compute-resource-block hide">
-	<div class="well">
-		<form action="{{URL::to('/')}}/gp/add-crp" method="POST">
-			<input type="hidden" name="gatewayId" id="gatewayId" value="">
-			<div class="input-group">
-				<select name="computeResourceId" class="cr-select form-control">
-					<option value="">Select a compute Resource and set its preferences</option>
-					@foreach( (array)$computeResources as $index => $cr)
-					<option value="{{ $cr->computeResourceId}}">{{ $cr->hostName }}</option>
-					@endforeach
-				</select>
-				<span class="input-group-addon remove-cr" style="cursor:pointer;">x</span>
-			</div>
-			<div class="pref-space form-horizontal"></div>
-		</form> 
-	</div>
+    <div class="well">
+        <form action="{{URL::to('/')}}/gp/add-crp" method="POST">
+            <input type="hidden" name="gatewayId" id="gatewayId" value="">
+
+            <div class="input-group">
+                <select name="computeResourceId" class="cr-select form-control">
+                    <option value="">Select a compute Resource and set its preferences</option>
+                    @foreach( (array)$computeResources as $index => $cr)
+                    <option value="{{ $cr->computeResourceId}}">{{ $cr->hostName }}</option>
+                    @endforeach
+                </select>
+                <span class="input-group-addon remove-cr" style="cursor:pointer;">x</span>
+            </div>
+            <div class="pref-space form-horizontal"></div>
+        </form>
+    </div>
 </div>
 
 <!-- Edit a Gateway Modal -->
-<div class="modal fade" id="edit-gateway-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="edit-gateway-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
 
-		<form action="{{URL::to('/')}}/gp/edit" method="POST">
-	        <div class="modal-content">
-	            <div class="modal-header">
-	              	<h3 class="text-center">Edit Gateway</h3>
-	            </div>
-	            <div class="modal-body">
-					<input type="hidden" class="form-control edit-gpId" name="edit-gpId"/>
-					<div class="form-group required">
-						<label class="control-label">Gateway Name</label>
-						<input class="form-control edit-gp-name" maxlength="100" name="gatewayName" required="required" placeholder="Gateway Name"/>
-					</div>
-					<div class="form-group">
-						<label class="control-label">Gateway Description</label>
-						<textarea class="form-control edit-gp-desc" maxlength="255" name="gatewayDescription" placeholder="Gateway Description"></textarea>
-					</div>
-				</div>
-				<div class="modal-footer">
-					<div class="form-group">
-						<input type="submit" class="btn btn-primary" value="Update"/>
-						<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					</div>
-				</div>
-			</div>
-
-		</form>
-	</div>
+        <form action="{{URL::to('/')}}/gp/edit" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Edit Gateway</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control edit-gpId" name="edit-gpId"/>
+
+                    <div class="form-group required">
+                        <label class="control-label">Gateway Name</label>
+                        <input class="form-control edit-gp-name" maxlength="100" name="gatewayName" required="required"
+                               placeholder="Gateway Name"/>
+                    </div>
+                    <div class="form-group">
+                        <label class="control-label">Gateway Description</label>
+                        <textarea class="form-control edit-gp-desc" maxlength="255" name="gatewayDescription"
+                                  placeholder="Gateway Description"></textarea>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-primary" value="Update"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
 </div>
 
 <!-- delete a Gateway Modal -->
-<div class="modal fade" id="delete-gateway-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="delete-gateway-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
 
-		<form action="{{URL::to('/')}}/gp/delete-gp" method="POST">
-	        <div class="modal-content">
-	            <div class="modal-header">
-	              	<h3 class="text-center">Delete Gateway Profile Confirmation</h3>
-	            </div>
-	            <div class="modal-body">
-					<input type="hidden" class="form-control delete-gpId" name="del-gpId"/>
-					Do you really want to delete the Gateway Profile, <span class="delete-gp-name"></span> ?
-				</div>
-				<div class="modal-footer">
-					<div class="form-group">
-						<input type="submit" class="btn btn-danger" value="Delete"/>
-						<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					</div>
-				</div>
-			</div>
-
-		</form>
-	</div>
+        <form action="{{URL::to('/')}}/gp/delete-gp" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Delete Gateway Profile Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control delete-gpId" name="del-gpId"/>
+                    Do you really want to delete the Gateway Profile, <span class="delete-gp-name"></span> ?
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Delete"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
 </div>
 
 <!-- Remove a Compute Resource from a Gateway -->
-<div class="modal fade" id="remove-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="remove-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
 
-		<form action="{{URL::to('/')}}/gp/remove-cr" method="POST">
-	        <div class="modal-content">
-	            <div class="modal-header">
-	              	<h3 class="text-center">Remove Compute Resource Confirmation</h3>
-	            </div>
-	            <div class="modal-body">
-					<input type="hidden" class="form-control remove-crId" name="rem-crId"/>
-					<input type="hidden" class="form-control cr-gpId" name="gpId"/>
-
-					Do you really want to remove the Compute Resource, <span class="remove-cr-name"> </span>from the selected Gateway?
-				</div>
-				<div class="modal-footer">
-					<div class="form-group">
-						<input type="submit" class="btn btn-danger" value="Remove"/>
-						<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					</div>
-				</div>
-			</div>
-
-		</form>
-	</div>
+        <form action="{{URL::to('/')}}/gp/remove-cr" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Remove Compute Resource Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control remove-crId" name="rem-crId"/>
+                    <input type="hidden" class="form-control cr-gpId" name="gpId"/>
+
+                    Do you really want to remove the Compute Resource, <span class="remove-cr-name"> </span>from the
+                    selected Gateway?
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Remove"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+    </div>
 </div>
 
 <!-- contains all compute resource choices that might get selected on adding a new one to a gateway -->
 @foreach( (array)$computeResources as $index => $cr)
-	@include('partials/gateway-preferences', array('computeResource' => $cr, 'crData' => $crData))
+@include('partials/gateway-preferences', array('computeResource' => $cr, 'crData' => $crData))
 @endforeach
 
 
 @stop
 
 @section('scripts')
-	@parent
-	{{ HTML::script('js/gateway.js') }}
+@parent
+{{ HTML::script('js/gateway.js') }}
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/gateway/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/gateway/create.blade.php b/app/views/gateway/create.blade.php
index 24cba9c..477c506 100644
--- a/app/views/gateway/create.blade.php
+++ b/app/views/gateway/create.blade.php
@@ -1,34 +1,37 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-		<h3>Create a Gateway</h3>
-		<form role="form" method="POST" action="{{ URL::to('/') }}/gp/create">
-			<div class="form-group required">
-				<label class="control-label">Enter Name</label>
-				<input class="form-control hostName" maxlength="100" name="gatewayName" required="required" placeholder="Gateway Name"/>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Enter Description</label>
-				<textarea class="form-control" maxlength="255" name="gatewayDescription" placeholder="Gateway Description"></textarea>
-			</div>
-			<div class="form-group">
-				<input type="submit" class="btn btn-lg btn-primary" value="Create"/>
-				<input type="reset" class="btn btn-lg btn-success" value="Reset"/>
-			</div>
-		</form>
-	</div>
+    <div class="col-md-offset-2 col-md-8">
+        <h3>Create a Gateway</h3>
+
+        <form role="form" method="POST" action="{{ URL::to('/') }}/gp/create">
+            <div class="form-group required">
+                <label class="control-label">Enter Name</label>
+                <input class="form-control hostName" maxlength="100" name="gatewayName" required="required"
+                       placeholder="Gateway Name"/>
+            </div>
+            <div class="form-group">
+                <label class="control-label">Enter Description</label>
+                <textarea class="form-control" maxlength="255" name="gatewayDescription"
+                          placeholder="Gateway Description"></textarea>
+            </div>
+            <div class="form-group">
+                <input type="submit" class="btn btn-lg btn-primary" value="Create"/>
+                <input type="reset" class="btn btn-lg btn-success" value="Reset"/>
+            </div>
+        </form>
+    </div>
 </div>
 
 @stop
 
 @section('scripts')
-	@parent
-    {{ HTML::script('js/script.js') }}
+@parent
+{{ HTML::script('js/script.js') }}
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/home.blade.php
----------------------------------------------------------------------
diff --git a/app/views/home.blade.php b/app/views/home.blade.php
index a3deeeb..158650c 100755
--- a/app/views/home.blade.php
+++ b/app/views/home.blade.php
@@ -1,7 +1,7 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
@@ -11,85 +11,15 @@
 
         <?php
 
-        if (Utilities::id_in_session())
-        {
+        if (CommonUtilities::id_in_session()) {
             $columnClass = 'col-md-4';
-            if( Session::has("admin"))
+            if (Session::has("admin"))
                 $admin = " Admin";
             else
                 $admin = "";
 
-            echo '<h4>Welcome'. $admin . ', '. Session::get("username") . '!</h4>';
-
-            if( Session::get("username") == 'admin1') // temporary hard-coded admin user. will replace with admin role in future
-            {
-                try
-                {
-                    Utilities::open_tokens_file($tokenFilePath);
-                }
-                catch (Exception $e)
-                {
-                    Utilities::print_error_message($e->getMessage());
-                }
-
-
-                if(isset($_GET['tokenId']))
-                {
-                    try
-                    {
-                        Utilities::write_new_token($_GET['tokenId']);
-
-                        Utilties::print_success_message('Received new XSEDE token ' . $tokenFile->tokenId .
-                            '! Click <a href="' . $req_url .
-                            '?gatewayName=' . $gatewayName .
-                            '&email=' . $email .
-                            '&portalUserName=' . $_SESSION['username'] .
-                            '">here</a> to fetch a new token.');
-                    }
-                    catch (Exception $e)
-                    {
-                        print_error_message($e->getMessage());
-                    }
-                }
-                else
-                {
-                    echo '<p><small>Community token currently set to ' . $tokenFile->tokenId .
-                        '. Click <a href="' . $req_url .
-                        '?gatewayName=' . $gatewayName .
-                        '&email=' . $email .
-                        '&portalUserName=' . $_SESSION['username'] .
-                        '">here</a> to fetch a new token.</small></p>';
-                }
-            }
-            else // standard user
-            {
-                /* temporarily remove to avoid confusion during XSEDE tutorial
-                if (isset($_SESSION['tokenId']))
-                {
-                    echo '<p><small>XSEDE token currently active.
-                    All experiments launched during this session will use your personal allocation.</small></p>';
-                }
-                elseif(!isset($_GET['tokenId']) && !isset($_SESSION['tokenId']))
-                {
-                    echo '<p><small>Currently using community allocation. Click <a href="' .
-                        $req_url .
-                        '?gatewayName=' . $gatewayName .
-                        '&email=' . $email .
-                        '&portalUserName=' . $_SESSION['username'] .
-                        '">here</a> to use your personal allocation for this session.</small></p>';
-                }
-                elseif(isset($_GET['tokenId']))
-                {
-                    $_SESSION['tokenId'] = $_GET['tokenId'];
-
-                    print_success_message('Received XSEDE token!' .
-                        '<br>All experiments launched during this session will use your personal allocation.');
-                }
-                */
-            }
-        }
-        else
-        {
+            echo '<h4>Welcome' . $admin . ', ' . Session::get("username") . '!</h4>';
+        } else {
             $columnClass = 'col-md-6';
 
             echo '
@@ -105,10 +35,7 @@
                     target="_blank">View the XSEDE 2014 tutorial documentation <span class="glyphicon glyphicon-new-window"></span></a></p>
             ';
         }
-
         ?>
-
-
     </div>
 </div>
 
@@ -117,12 +44,10 @@
     <div class="row">
         <?php
 
-        if (Utilities::id_in_session())
-        {
+        if (CommonUtilities::id_in_session()) {
             echo '
                 <div class="col-md-4">
                     <h2>PHP Gateway with Airavata</h2>
-
                     <p>
                         PGA is a science gateway built with the Airavata API. You can reference PGA as you integrate
                         Airavata into your own gateway, or you can create your gateway on top of PGA by cloning it at
@@ -140,6 +65,7 @@
         <div class="<?php echo $columnClass; ?>">
             <div class="thumbnail" style="border:none">
                 <img src="assets/scigap-header-logo.png" alt="SciGaP">
+
                 <div class="caption">
                     <p>
                         SciGaP is a hosted service with a public API that science gateways can use to manage
@@ -147,11 +73,13 @@
                         developers can thus concentrate their efforts on building their scientific communities and not
                         worry about operations.
                     </p>
+
                     <p>
                         Science Gateway Platform as a Service (SciGaP) provides application programmer interfaces (APIs)
                         to hosted generic infrastructure services that can be used by domain science communities to
                         create Science Gateways.
                     </p>
+
                     <p><a href="http://scigap.org/"
                           target="_blank">Learn more <span class="glyphicon glyphicon-new-window"></span></a></p>
                 </div>
@@ -160,6 +88,7 @@
         <div class="<?php echo $columnClass; ?>">
             <div class="thumbnail" style="border:none">
                 <img src="assets/PoweredbyAiravata_Small.png" alt="Apache Airavata">
+
                 <div class="caption">
                     <p>
                         Apache Airavata is a software framework which is dominantly used to build Web-based science
@@ -168,7 +97,9 @@
                         grids, academic and commercial clouds. Airavata mainly supports long running applications and
                         workflows on distributed computational resources.
                     </p>
-                    <p><a href="http://airavata.apache.org/" target="_blank">Learn more <span class="glyphicon glyphicon-new-window"></span></a></p>
+
+                    <p><a href="http://airavata.apache.org/" target="_blank">Learn more <span
+                                class="glyphicon glyphicon-new-window"></span></a></p>
                 </div>
             </div>
         </div>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/layout/basic.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/basic.blade.php b/app/views/layout/basic.blade.php
index 318b507..0915e3b 100755
--- a/app/views/layout/basic.blade.php
+++ b/app/views/layout/basic.blade.php
@@ -1,14 +1,14 @@
 @section ('page-header')
 
 <!DOCTYPE html>
-        <html lang="en">
-        <head>
-            <title>PHP Reference Gateway</title>
-            <meta charset="utf-8">
-            <meta name="viewport" content="width=device-width, initial-scale=1">
-            <link rel="icon" href="resources/assets/favicon.ico" type="image/x-icon">
-            {{ HTML::style('css/bootstrap.min.css')}}            
-        </head>
+<html lang="en">
+<head>
+    <title>PHP Reference Gateway</title>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="icon" href="resources/assets/favicon.ico" type="image/x-icon">
+    {{ HTML::style('css/bootstrap.min.css')}}
+</head>
 
 <?php
 
@@ -19,21 +19,19 @@
 
 <body>
 
-<?php Utilities::create_nav_bar(); ?>
+<?php CommonUtilities::create_nav_bar(); ?>
 
 <?php
-    // Alerts if guests users try to go to the link without signing in.
-    if( Session::has("login-alert"))
-    {
-        Utilities::print_error_message("You need to login to use this service.");
-        Session::forget("login-alert");
-    } 
-    // if signed in user is not an admin.           
-    if( Session::has("admin-alert"))
-    {
-        Utilities::print_error_message("You need to be an admin to use this service.");
-        Session::forget("admin-alert");
-    }
+// Alerts if guests users try to go to the link without signing in.
+if (Session::has("login-alert")) {
+    CommonUtilities::print_error_message("You need to login to use this service.");
+    Session::forget("login-alert");
+}
+// if signed in user is not an admin.
+if (Session::has("admin-alert")) {
+    CommonUtilities::print_error_message("You need to be an admin to use this service.");
+    Session::forget("admin-alert");
+}
 ?>
 
 @show
@@ -42,72 +40,70 @@
 
 </body>
 @section('scripts')
-    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
-    <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
+<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
+<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
 
-    <!-- Jira Issue Collector - Report Issue -->
-    <script type="text/javascript"
-            src="https://gateways.atlassian.net/s/31280375aecc888d5140f63e1dc78a93-T/en_USmlc07/6328/46/1.4.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=b1572922"></script>
+<!-- Jira Issue Collector - Report Issue -->
+<script type="text/javascript"
+        src="https://gateways.atlassian.net/s/31280375aecc888d5140f63e1dc78a93-T/en_USmlc07/6328/46/1.4.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=b1572922"></script>
 
-    <!-- Jira Issue Collector - Request Feature -->
-    <script type="text/javascript"
+<!-- Jira Issue Collector - Request Feature -->
+<script type="text/javascript"
         src="https://gateways.atlassian.net/s/31280375aecc888d5140f63e1dc78a93-T/en_USmlc07/6328/46/1.4.13/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=674243b0"></script>
 
 
-    <script type="text/javascript">
-        window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
-            "b1572922":
-            {
-                "triggerFunction": function(showCollectorDialog) {
-                    //Requries that jQuery is available!
-                    jQuery("#report-issue").click(function(e) {
-                        e.preventDefault();
-                        showCollectorDialog();
-                    });
-                }
-            },
-            "674243b0":
-            {
-                "triggerFunction": function(showCollectorDialog) {
-                    //Requries that jQuery is available!
-                    jQuery("#request-feature").click(function(e) {
-                        e.preventDefault();
-                        showCollectorDialog();
-                    });
-                }
+<script type="text/javascript">
+    window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
+        "b1572922": {
+            "triggerFunction": function (showCollectorDialog) {
+                //Requries that jQuery is available!
+                jQuery("#report-issue").click(function (e) {
+                    e.preventDefault();
+                    showCollectorDialog();
+                });
             }
-        });
-
-        var highest = null;
-        $(".nav-tabs a").each(function(){  //find the height of your highest link
-            var h = $(this).height();
-            if(h > highest){
-                highest = $(this).height();  
-            }    
-        });
-
-        $(".nav-tabs a").height(highest);  //set all your links to that height.
-
+        },
+        "674243b0": {
+            "triggerFunction": function (showCollectorDialog) {
+                //Requries that jQuery is available!
+                jQuery("#request-feature").click(function (e) {
+                    e.preventDefault();
+                    showCollectorDialog();
+                });
+            }
+        }
+    });
 
-        // not letting users to add only spaces in text boxes.
-        $("body").on( "blur", ".form-control", function(){
-            $(this).val( $.trim( $(this).val() ) );
-        });
-        
-        //find users' current time.
-        if("{{ Session::get('user_time') }}".length==0){
-            var visitortime = new Date();
-            var visitortimezone = visitortime.getTimezoneOffset()/60;
-            $.ajax({
-                type:"GET",
-                url:"{{URL::to('/')}}/setUserTimezone",
-                data: 'timezone='+ visitortimezone,
-                success: function(){
-                    //location.reload();
-                }
-            });
+    var highest = null;
+    $(".nav-tabs a").each(function () {  //find the height of your highest link
+        var h = $(this).height();
+        if (h > highest) {
+            highest = $(this).height();
         }
-    </script>
+    });
+
+    $(".nav-tabs a").height(highest);  //set all your links to that height.
+
+
+    // not letting users to add only spaces in text boxes.
+    $("body").on("blur", ".form-control", function () {
+        $(this).val($.trim($(this).val()));
+    });
+
+    //find users' current time.
+    if ("{{ Session::get('user_time') }}".length == 0) {
+        var visitortime = new Date();
+        var visitortimezone = visitortime.getTimezoneOffset() / 60;
+        $.ajax({
+            type: "GET",
+            url: "{{URL::to('/')}}/setUserTimezone",
+            data: 'timezone=' + visitortimezone,
+            success: function () {
+                //location.reload();
+            }
+        });
+    }
+</script>
 
 @show
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/dashboard-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/dashboard-block.blade.php b/app/views/partials/dashboard-block.blade.php
index a30530b..70692c3 100644
--- a/app/views/partials/dashboard-block.blade.php
+++ b/app/views/partials/dashboard-block.blade.php
@@ -1,50 +1,54 @@
 <div class="collapse navbar-collapse navbar-ex1-collapse">
-                <ul class="nav navbar-nav side-nav">
-                    <li @if( Session::has("manage"))  class="active" @endif>
-                        <a href="{{ URL::to('/')}}/admin/dashboard/gateway"><i class="fa fa-fw fa-dashboard"></i>@if( Session::has("scigap_admin"))Gateways @else Gateway @endif</a>
-                    </li>
-                    <li>
-                        <a href="{{ URL::to('/')}}/admin/dashboard/users"><i class="fa fa-fw fa-bar-chart-o"></i> Users</a>
-                    </li>
-                    <li>
-                        <a href="{{ URL::to('/')}}/admin/dashboard/roles"><i class="fa fa-fw fa-table"></i>Roles</a>
-                    </li>
-                    <li>
-                        <a href="{{ URL::to('/')}}/admin/dashboard/credential-store"><i class="fa fa-fw fa-table"></i>Credential Store</a>
-                    </li>
-                    <li>
-                        <a href="{{ URL::to('/')}}/admin/dashboard/resources"><i class="fa fa-fw fa-table"></i>Resources</a>
-                    </li>
-                    <li>
-                        <a href="{{ URL::to('/')}}/admin/dashboard/experiments"><i class="fa fa-fw fa-experiments"></i>Experiments</a>
-                    </li>
-                    <li>
-                        <a href="forms.html"><i class="fa fa-fw fa-edit"></i> Settings</a>
-                    </li>
-                    <!-- 
-                    <li>
-                        <a href="bootstrap-elements.html"><i class="fa fa-fw fa-desktop"></i> Bootstrap Elements</a>
-                    </li>
-                    <li>
-                        <a href="bootstrap-grid.html"><i class="fa fa-fw fa-wrench"></i> Bootstrap Grid</a>
-                    </li>
-                    <li>
-                        <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-arrows-v"></i> Dropdown <i class="fa fa-fw fa-caret-down"></i></a>
-                        <ul id="demo" class="collapse">
-                            <li>
-                                <a href="#">Dropdown Item</a>
-                            </li>
-                            <li>
-                                <a href="#">Dropdown Item</a>
-                            </li>
-                        </ul>
-                    </li>
-                    <li>
-                        <a href="blank-page.html"><i class="fa fa-fw fa-file"></i> Blank Page</a>
-                    </li>
-                    <li>
-                        <a href="index-rtl.html"><i class="fa fa-fw fa-dashboard"></i> RTL Dashboard</a>
-                    </li>
-                    -->
-                </ul>
-            </div>
+    <ul class="nav navbar-nav side-nav">
+        <li
+        @if( Session::has("manage")) class="active" @endif>
+        <a href="{{ URL::to('/')}}/admin/dashboard/gateway"><i class="fa fa-fw fa-dashboard"></i>@if(
+            Session::has("scigap_admin"))Gateways @else Gateway @endif</a>
+        </li>
+        <li>
+            <a href="{{ URL::to('/')}}/admin/dashboard/users"><i class="fa fa-fw fa-bar-chart-o"></i> Users</a>
+        </li>
+        <li>
+            <a href="{{ URL::to('/')}}/admin/dashboard/roles"><i class="fa fa-fw fa-table"></i>Roles</a>
+        </li>
+        <li>
+            <a href="{{ URL::to('/')}}/admin/dashboard/credential-store"><i class="fa fa-fw fa-table"></i>Credential
+                Store</a>
+        </li>
+        <li>
+            <a href="{{ URL::to('/')}}/admin/dashboard/resources"><i class="fa fa-fw fa-table"></i>Resources</a>
+        </li>
+        <li>
+            <a href="{{ URL::to('/')}}/admin/dashboard/experiments"><i
+                    class="fa fa-fw fa-experiments"></i>Experiments</a>
+        </li>
+        <li>
+            <a href="forms.html"><i class="fa fa-fw fa-edit"></i> Settings</a>
+        </li>
+        <!--
+        <li>
+            <a href="bootstrap-elements.html"><i class="fa fa-fw fa-desktop"></i> Bootstrap Elements</a>
+        </li>
+        <li>
+            <a href="bootstrap-grid.html"><i class="fa fa-fw fa-wrench"></i> Bootstrap Grid</a>
+        </li>
+        <li>
+            <a href="javascript:;" data-toggle="collapse" data-target="#demo"><i class="fa fa-fw fa-arrows-v"></i> Dropdown <i class="fa fa-fw fa-caret-down"></i></a>
+            <ul id="demo" class="collapse">
+                <li>
+                    <a href="#">Dropdown Item</a>
+                </li>
+                <li>
+                    <a href="#">Dropdown Item</a>
+                </li>
+            </ul>
+        </li>
+        <li>
+            <a href="blank-page.html"><i class="fa fa-fw fa-file"></i> Blank Page</a>
+        </li>
+        <li>
+            <a href="index-rtl.html"><i class="fa fa-fw fa-dashboard"></i> RTL Dashboard</a>
+        </li>
+        -->
+    </ul>
+</div>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/deployment-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/deployment-block.blade.php b/app/views/partials/deployment-block.blade.php
index b624c3a..58722a1 100644
--- a/app/views/partials/deployment-block.blade.php
+++ b/app/views/partials/deployment-block.blade.php
@@ -5,121 +5,140 @@
 </div>
 -->
 @if( isset( $deploymentObject) )
-	<input type="hidden" name="app-deployment-id" value="{{$deploymentObject->appDeploymentId}}"/>
+<input type="hidden" name="app-deployment-id" value="{{$deploymentObject->appDeploymentId}}"/>
 @endif
 <div class="form-group required">
-	<label class="control-label">Application Module</label>
-	<select name="appModuleId" class="form-control app-module-filter" required readonly>
-	@foreach( $modules as $index => $module)
-		<option value="{{ $module->appModuleId }}" @if( isset( $deploymentObject) ) @if( $module->appModuleId == $deploymentObject->appModuleId) selected @endif @endif>{{ $module->appModuleName }}</option>	
-	@endforeach
-	</select>
+    <label class="control-label">Application Module</label>
+    <select name="appModuleId" class="form-control app-module-filter" required readonly>
+        @foreach( $modules as $index => $module)
+        <option value="{{ $module->appModuleId }}"
+        @if( isset( $deploymentObject) ) @if( $module->appModuleId == $deploymentObject->appModuleId) selected @endif
+        @endif>{{ $module->appModuleName }}</option>
+        @endforeach
+    </select>
 </div>
 <div class="form-group required">
-	<label class="control-label">Application Compute Host</label>
-	<select name="computeHostId" class="form-control" required readonly>
-	@foreach( $computeResources as $id => $crName)
-		<option value="{{ $id }}" @if( isset( $deploymentObject) ) @if( $id == $deploymentObject->computeHostId) selected @endif @endif>{{ $crName }}</option>	
-	@endforeach
-	</select>
+    <label class="control-label">Application Compute Host</label>
+    <select name="computeHostId" class="form-control" required readonly>
+        @foreach( $computeResources as $id => $crName)
+        <option value="{{ $id }}"
+        @if( isset( $deploymentObject) ) @if( $id == $deploymentObject->computeHostId) selected @endif @endif>{{ $crName
+        }}</option>
+        @endforeach
+    </select>
 </div>
 <div class="form-group required">
-	<label class="control-label">Application Executable Path</label>
-	<input type="text" class="form-control" name="executablePath" value="@if( isset( $deploymentObject)){{$deploymentObject->executablePath}}@endif" required readonly/>
+    <label class="control-label">Application Executable Path</label>
+    <input type="text" class="form-control" name="executablePath"
+           value="@if( isset( $deploymentObject)){{$deploymentObject->executablePath}}@endif" required readonly/>
 </div>
 <div class="form-group required">
-	<label class="control-label">Application Parallelism Type</label>
-	<select name="parallelism" class="form-control" readonly>
-	@foreach( $applicationParallelismTypes as $index=>$parallelismType)
-		<option value="{{$index}}" @if( isset( $deploymentObject) ) @if( $index == $deploymentObject->parallelism) selected @endif @endif>{{ $parallelismType }}</option>
-	@endforeach
-	</select>
+    <label class="control-label">Application Parallelism Type</label>
+    <select name="parallelism" class="form-control" readonly>
+        @foreach( $applicationParallelismTypes as $index=>$parallelismType)
+        <option value="{{$index}}"
+        @if( isset( $deploymentObject) ) @if( $index == $deploymentObject->parallelism) selected @endif @endif>{{
+        $parallelismType }}</option>
+        @endforeach
+    </select>
 </div>
 <div class="form-group">
-	<label class="control-label">Application Deployment Description</label>
-	<textarea class="form-control" name="appDeploymentDescription" readonly>@if( isset( $deploymentObject)){{$deploymentObject->appDeploymentDescription}}@endif</textarea>
+    <label class="control-label">Application Deployment Description</label>
+    <textarea class="form-control" name="appDeploymentDescription" readonly>@if( isset(
+        $deploymentObject)){{$deploymentObject->appDeploymentDescription}}@endif</textarea>
 </div>
 <hr/>
 <div class="form-group">
-	<div class="show-load-cmds">
-		@if( isset( $deploymentObject))
-			@foreach( (array)$deploymentObject->moduleLoadCmds as $index => $cmd)
-				<input name="moduleLoadCmds[]" type="text" class="form-control" placeholder="Module Load Command" value="{{$cmd}}" readonly />
-			@endforeach
-		@endif
-	</div>
-	<button type="button" class="btn btn-default control-label add-load-cmd hide">Add Module Load Commands</label>
+    <div class="show-load-cmds">
+        @if( isset( $deploymentObject))
+        @foreach( (array)$deploymentObject->moduleLoadCmds as $index => $cmd)
+        <input name="moduleLoadCmds[]" type="text" class="form-control" placeholder="Module Load Command"
+               value="{{$cmd}}" readonly/>
+        @endforeach
+        @endif
+    </div>
+    <button type="button" class="btn btn-default control-label add-load-cmd hide">Add Module Load Commands</button>
 </div>
 <hr/>
 <div class="form-group">
-	<div class="show-lib-prepend-paths">
-		<h5>Library Prepend Paths</h5>
-		@if( isset( $deploymentObject))
-			@foreach( (array)$deploymentObject->libPrependPaths as $path)
-				<div class="col-md-12 well">
-					<input name="libraryPrependPathName[]" type="text" class="col-md-4" placeholder="Name" value="{{$path->name}}" readonly/>
-					<input name="libraryPrependPathValue[]" type="text" class="col-md-8" placeholder="Value" value="{{$path->value}}" readonly/>
-				</div>
-			@endforeach
-		@endif
-	</div>
-	<button type="button" class="btn btn-default control-label add-lib-prepend-path hide">Add a Library Prepend Path</label>
+    <div class="show-lib-prepend-paths">
+        <h5>Library Prepend Paths</h5>
+        @if( isset( $deploymentObject))
+        @foreach( (array)$deploymentObject->libPrependPaths as $path)
+        <div class="col-md-12 well">
+            <input name="libraryPrependPathName[]" type="text" class="col-md-4" placeholder="Name"
+                   value="{{$path->name}}" readonly/>
+            <input name="libraryPrependPathValue[]" type="text" class="col-md-8" placeholder="Value"
+                   value="{{$path->value}}" readonly/>
+        </div>
+        @endforeach
+        @endif
+    </div>
+    <button type="button" class="btn btn-default control-label add-lib-prepend-path hide">Add a Library Prepend Path
+    </button>
 </div>
 <hr/>
 <div class="form-group">
-	<div class="show-lib-append-paths">
-		<h5>Library Append Paths</h5>
-		@if( isset( $deploymentObject))
-			@foreach( (array)$deploymentObject->libAppendPaths as $path)
-				<div class="col-md-12 well">
-					<input name="libraryAppendPathName[]" type="text" class="col-md-4" placeholder="Name" value="{{$path->name}}" readonly/>
-					<input name="libraryAppendPathValue[]" type="text" class="col-md-8" placeholder="Value" value="{{$path->value}}" readonly/>
-				</div>
-			@endforeach
-		@endif
-	</div>
-	<button type="button" class="btn btn-default control-label add-lib-append-path hide">Add a Library Append Path</label>
+    <div class="show-lib-append-paths">
+        <h5>Library Append Paths</h5>
+        @if( isset( $deploymentObject))
+        @foreach( (array)$deploymentObject->libAppendPaths as $path)
+        <div class="col-md-12 well">
+            <input name="libraryAppendPathName[]" type="text" class="col-md-4" placeholder="Name"
+                   value="{{$path->name}}" readonly/>
+            <input name="libraryAppendPathValue[]" type="text" class="col-md-8" placeholder="Value"
+                   value="{{$path->value}}" readonly/>
+        </div>
+        @endforeach
+        @endif
+    </div>
+    <button type="button" class="btn btn-default control-label add-lib-append-path hide">Add a Library Append Path
+    </button>
 </div>
 <hr/>
 <div class="form-group">
-	<div class="show-environments">
-		<h5>Environments</h5>
-		@if( isset( $deploymentObject))
-			@foreach( (array)$deploymentObject->setEnvironment as $path)
-				<div class="col-md-12 well">
-					<input name="environmentName[]" type="text" class="col-md-4" placeholder="Name" value="{{$path->name}}" readonly/>
-					<input name="environmentValue[]" type="text" class="col-md-8" placeholder="Value" value="{{$path->value}}" readonly/>
-				</div>
-			@endforeach
-		@endif
-	</div>
-	<button type="button" class="btn btn-default control-label add-environment hide">Add Environment</label>
+    <div class="show-environments">
+        <h5>Environments</h5>
+        @if( isset( $deploymentObject))
+        @foreach( (array)$deploymentObject->setEnvironment as $path)
+        <div class="col-md-12 well">
+            <input name="environmentName[]" type="text" class="col-md-4" placeholder="Name" value="{{$path->name}}"
+                   readonly/>
+            <input name="environmentValue[]" type="text" class="col-md-8" placeholder="Value" value="{{$path->value}}"
+                   readonly/>
+        </div>
+        @endforeach
+        @endif
+    </div>
+    <button type="button" class="btn btn-default control-label add-environment hide">Add Environment</button>
 </div>
 
 <div class="form-group">
-	<div class="show-preJobCommands">
-		<h5>Pre Job Commands</h5>
-		@if( isset( $deploymentObject))
-			@foreach( (array)$deploymentObject->preJobCommands as $preJobCommand)
-				<div class="col-md-12 well">
-					<input name="preJobCommand[]" type="text" class="col-md-12" placeholder="Pre Job Command" value="{{$preJobCommand}}" readonly/>
-				</div>
-			@endforeach
-		@endif
-	</div>
-	<button type="button" class="btn btn-default control-label add-preJobCommand hide">Add Pre Job Command</label>
+    <div class="show-preJobCommands">
+        <h5>Pre Job Commands</h5>
+        @if( isset( $deploymentObject))
+        @foreach( (array)$deploymentObject->preJobCommands as $preJobCommand)
+        <div class="col-md-12 well">
+            <input name="preJobCommand[]" type="text" class="col-md-12" placeholder="Pre Job Command"
+                   value="{{$preJobCommand}}" readonly/>
+        </div>
+        @endforeach
+        @endif
+    </div>
+    <button type="button" class="btn btn-default control-label add-preJobCommand hide">Add Pre Job Command</button>
 </div>
 
 <div class="form-group">
-	<div class="show-postJobCommands">
-		<h5>Post Job Commands</h5>
-		@if( isset( $deploymentObject))
-			@foreach( (array)$deploymentObject->postJobCommands as $postJobCommand)
-				<div class="col-md-12 well">
-					<input name="postJobCommand[]" type="text" class="col-md-12" placeholder="Post Job Command" value="{{$postJobCommand}}" readonly/>
-				</div>
-			@endforeach
-		@endif
-	</div>
-	<button type="button" class="btn btn-default control-label add-postJobCommand hide">Add Post Job Command</label>
+    <div class="show-postJobCommands">
+        <h5>Post Job Commands</h5>
+        @if( isset( $deploymentObject))
+        @foreach( (array)$deploymentObject->postJobCommands as $postJobCommand)
+        <div class="col-md-12 well">
+            <input name="postJobCommand[]" type="text" class="col-md-12" placeholder="Post Job Command"
+                   value="{{$postJobCommand}}" readonly/>
+        </div>
+        @endforeach
+        @endif
+    </div>
+    <button type="button" class="btn btn-default control-label add-postJobCommand hide">Add Post Job Command</button>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index a57f922..623eb53 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -1,19 +1,19 @@
-    <div class="container" style="max-width: 750px;">
+<div class="container" style="max-width: 750px;">
 
     @if(isset( $invalidExperimentId ) )
-        <div class="alert alert-danger">
-            The Experiment ID does not exist. Please go to correct experiment.
-        </div>
+    <div class="alert alert-danger">
+        The Experiment ID does not exist. Please go to correct experiment.
+    </div>
     @else
     <h1>
         Experiment Summary
         @if( !isset($dashboard))
         <small><a href="{{ URL::to('/') }}/experiment/summary?expId={{ $experiment->experimentID }}"
                   title="Refresh"><span class="glyphicon glyphicon-refresh refresh-exp"></span></a></small>
-    	@endif
+        @endif
     </h1>
-    
-    
+
+
     <table class="table">
         <tr>
             <td><strong>Experiment Id</strong></td>
@@ -57,16 +57,16 @@
             <td><strong>Working Dir</strong></td>
 
             <?php
-            foreach($jobDetails as $job) echo '
+            foreach ($jobDetails as $job) echo '
                 <td>' . $job->workingDir . '</td>
             ';
             ?>
         </tr>
-         <tr>
+        <tr>
             <td><strong>Job Description</strong></td>
 
             <?php
-            foreach($jobDetails as $job) echo '
+            foreach ($jobDetails as $job) echo '
                 <td>' . $job->jobDescription . '</td>
             ';
             ?>
@@ -99,23 +99,23 @@
         </tr>
         <tr>
             <td><strong>Inputs</strong></td>
-            <td><?php Utilities::list_input_files($experiment); ?></td>
+            <td><?php ProjectUtilities::get_project($experiment->projectID); ?></td>
         </tr>
         <tr>
             <td><strong>Outputs</strong></td>
-            <td><?php Utilities::list_output_files($experiment, $expVal["experimentStatusString"]); ?></td>
+            <td><?php ExperimentUtilities::list_output_files($experiment, $expVal["experimentStatusString"]); ?></td>
         </tr>
         @if( $expVal["experimentStatusString"] == "FAILED")
         <tr>
             <td><strong>Errors</strong></td>
             <td>
                 @foreach( (array)$experiment->errors as $error)
-                    {{ $error->actualErrorMessage }}
+                {{ $error->actualErrorMessage }}
                 @endforeach
             </td>
         </tr>
         @endif
-        
+
     </table>
 
     @if( !isset( $dashboard))
@@ -125,12 +125,13 @@
                    type="submit"
                    class="btn btn-success"
                    value="Launch"
-                   title="Launch the experiment" <?php if(!$expVal["editable"] ) echo 'disabled'  ?>>
+                   title="Launch the experiment" <?php if (!$expVal["editable"]) echo 'disabled' ?>>
             <a href="{{URL::to('/') }}/experiment/cancel?expId={{ $experiment->experimentID }}"
                class="btn btn-default"
                role="button"
-               title="Edit the experiment's settings" <?php if(!$expVal["cancelable"] ) echo 'disabled'  ?>>
-                <input name="cancel" type="submit" class="btn btn-warning" value="Cancel" <?php if(!$expVal["cancelable"]) echo 'disabled';  ?> >
+               title="Edit the experiment's settings" <?php if (!$expVal["cancelable"]) echo 'disabled' ?>>
+                <input name="cancel" type="submit" class="btn btn-warning"
+                       value="Cancel" <?php if (!$expVal["cancelable"]) echo 'disabled'; ?> >
             </a>
             <input name="clone"
                    type="submit"
@@ -142,7 +143,7 @@
             <a href="{{URL::to('/') }}/experiment/edit?expId={{ $experiment->experimentID }}"
                class="btn btn-default"
                role="button"
-               title="Edit the experiment's settings" <?php if(!$expVal["editable"] ) echo 'disabled'  ?>>
+               title="Edit the experiment's settings" <?php if (!$expVal["editable"]) echo 'disabled' ?>>
                 <span class="glyphicon glyphicon-pencil"></span>
                 Edit
             </a>
@@ -157,5 +158,5 @@
 
 @section('scripts')
 @parent
-    {{ HTML::script('js/time-conversion.js')}}
+{{ HTML::script('js/time-conversion.js')}}
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/experiment-inputs.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-inputs.blade.php b/app/views/partials/experiment-inputs.blade.php
index b66381d..93d2aa5 100644
--- a/app/views/partials/experiment-inputs.blade.php
+++ b/app/views/partials/experiment-inputs.blade.php
@@ -1,25 +1,29 @@
 <div class="form-group required">
     <label for="experiment-name" class="control-label">Experiment Name</label>
-    <input type="text" class="form-control" name="experiment-name" id="experiment-name" placeholder="Enter experiment name" autofocus required="required" {{ $expInputs['disabled'] }} value="{{ $expInputs['experimentName'] }}">
+    <input type="text" class="form-control" name="experiment-name" id="experiment-name"
+           placeholder="Enter experiment name" autofocus required="required" {{ $expInputs['disabled'] }} value="{{
+    $expInputs['experimentName'] }}">
 </div>
 <div class="form-group">
     <label for="experiment-description">Experiment Description</label>
-    <textarea class="form-control" name="experiment-description" id="experiment-description" placeholder="Optional: Enter a short description of the experiment" {{ $expInputs['disabled'] }}>{{ $expInputs['experimentDescription'] }}</textarea>
+    <textarea class="form-control" name="experiment-description" id="experiment-description"
+              placeholder="Optional: Enter a short description of the experiment" {{ $expInputs['disabled'] }}>{{
+    $expInputs['experimentDescription'] }}</textarea>
 </div>
 <div class="form-group required">
     <label for="project" class="control-label">Project</label>
     @if( isset( $expInputs['cloning']))
-        {{ Utilities::create_project_select($expInputs['experiment']->projectID, $expInputs['expVal']['editable']) }}
+    {{ ProjectUtilities::create_project_select($expInputs['experiment']->projectID, $expInputs['expVal']['editable']) }}
     @else
-        {{ Utilities::create_project_select($expInputs['project'], !$expInputs['disabled']) }}
+    {{ ProjectUtilities::create_project_select($expInputs['project'], !$expInputs['disabled']) }}
     @endif
 </div>
-    <div class="form-group">
+<div class="form-group">
     <label for="application">Application</label>
     @if( isset( $expInputs['cloning']))
-        {{ Utilities::create_application_select($expInputs['application'], false)}}
+    {{ ExperimentUtilities::create_application_select($expInputs['application'], false)}}
     @else
-        {{ Utilities::create_application_select($expInputs['application'], !$expInputs['disabled']) }}
+    {{ ExperimentUtilities::create_application_select($expInputs['application'], !$expInputs['disabled']) }}
     @endif
 </div>
 
@@ -27,63 +31,75 @@
     <div class="panel-heading">Application configuration</div>
     <div class="panel-body">
         <label>Application input</label>
+
         <div class="well">
             <input type="hidden" id="allowedFileSize" value="{{$expInputs['allowedFileSize']}}"/>
             @if( isset( $expInputs['cloning']))
-                <div class="form-group">
-                    <p><strong>Current inputs</strong></p>
-                    {{ Utilities::list_input_files($expInputs['experiment']) }}
-                </div>
-                {{ Utilities::create_inputs($expInputs['application'], false) }}
+            <div class="form-group">
+                <p><strong>Current inputs</strong></p>
+                {{ ExperimentUtilities::list_input_files($expInputs['experiment']) }}
+            </div>
+            {{ ExperimentUtilities::create_inputs($expInputs['application'], false) }}
             @else
-                {{ Utilities::create_inputs($expInputs['application'], true) }}
+            {{ ExperimentUtilities::create_inputs($expInputs['application'], true) }}
             @endif
 
         </div>
         <div class="form-group required">
             <label class="control-label" for="compute-resource">Compute Resource</label>
             @if( count( $expInputs['computeResources']) > 0)
-                <select class="form-control" name="compute-resource" id="compute-resource" required="required">
-                    <option value="">Select a resource</option>
+            <select class="form-control" name="compute-resource" id="compute-resource" required="required">
+                <option value="">Select a resource</option>
                 @foreach ($expInputs['computeResources'] as $id => $name)
-                    <option value="{{$id}}" {{ ($expInputs['resourceHostId'] == $id)? ' selected' : '' }}>{{$name}}</option>
+                <option value="{{$id}}"
+                {{ ($expInputs['resourceHostId'] == $id)? ' selected' : '' }}>{{$name}}</option>
                 @endforeach
-                </select>
+            </select>
             @else
-                <h4>Application deployed Computational resources are currently available
-            @endif
+            <h4>Application deployed Computational resources are currently available
+                @endif
         </div>
         <div class="queue-block">
             <div class="loading-img text-center hide">
                 <img src="../assets/ajax-loader.gif"/>
             </div>
-            <input type="hidden" name="selected-queue" value="@if(isset($expInputs['expVal']) ){{ $expInputs['expVal']['scheduling']->queueName }} @endif"/>
+            <input type="hidden" name="selected-queue"
+                   value="@if(isset($expInputs['expVal']) ){{ $expInputs['expVal']['scheduling']->queueName }} @endif"/>
+
             <div class="queue-view">
                 @if(isset($expInputs['expVal']) )
-                    @include( 'partials/experiment-queue-block', array('queues'=> $expInputs['expVal']['computeResource']->batchQueues, 'expVal' => $expInputs['expVal']) )
+                @include( 'partials/experiment-queue-block', array('queues'=>
+                $expInputs['expVal']['computeResource']->batchQueues, 'expVal' => $expInputs['expVal']) )
                 @endif
+            </div>
         </div>
     </div>
-</div>
-<h3>Notifications</h3>
-<div class="form-group well">
-	<label for=""></label>
-	<input type="checkbox" id="enableEmail" name="enableEmailNotification" value="1"> Do you want to receive email notifications for status changes in the experiment?<br/>
-	<div class="emailSection hide">
-		<h4>Enter Email Address here.</h4>
-		<div class="emailAddresses">
-			<input type="email" id="emailAddresses" class="form-control" name="emailAddresses[]" placeholder="Email"/>
-		</div>
-		<button type="button" class="addEmail btn btn-default">Add another Email</button>
-	</div>
-</div>
+    <h3>Notifications</h3>
+
+    <div class="form-group well">
+        <label for=""></label>
+        <input type="checkbox" id="enableEmail" name="enableEmailNotification" value="1"> Do you want to receive email
+        notifications for status changes in the experiment?<br/>
 
-@if( $expInputs["advancedOptions"])
-<h3>Advanced Options</h3>
-<div class="form-group well">
-    <h4>Enter UserDN</h4>
-    <div class="userdninfo">
-        <input type="text" class="form-control" name="userDN" placeholder="user"/>
+        <div class="emailSection hide">
+            <h4>Enter Email Address here.</h4>
+
+            <div class="emailAddresses">
+                <input type="email" id="emailAddresses" class="form-control" name="emailAddresses[]"
+                       placeholder="Email"/>
+            </div>
+            <button type="button" class="addEmail btn btn-default">Add another Email</button>
+        </div>
     </div>
-</div>
-@endif
+
+    @if( $expInputs["advancedOptions"])
+    <h3>Advanced Options</h3>
+
+    <div class="form-group well">
+        <h4>Enter UserDN</h4>
+
+        <div class="userdninfo">
+            <input type="text" class="form-control" name="userDN" placeholder="user"/>
+        </div>
+    </div>
+    @endif


[10/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
Cleaning and restructuring PGA


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/2fbd9289
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/2fbd9289
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/2fbd9289

Branch: refs/heads/master
Commit: 2fbd92892f9e4460dcaa65c72981a7b1017da832
Parents: 71890a7
Author: Supun Nakandala <sc...@apache.org>
Authored: Fri Jun 5 03:45:04 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Fri Jun 5 03:45:04 2015 +0530

----------------------------------------------------------------------
 app/config/pga_config.php                       |    5 +
 app/controllers/AccountController.php           |  119 +-
 app/controllers/ComputeResource.php             |  439 ++--
 app/controllers/ExperimentController.php        |  528 +++--
 app/controllers/ProjectController.php           |  171 +-
 app/controllers/ResourceController.php          |  439 ++--
 app/filters.php                                 |   80 +-
 app/libraries/AdminUtilities.php                |   20 +-
 app/libraries/AiravataClientFactory.php         |   24 -
 app/libraries/AppUtilities.php                  |  514 +++--
 app/libraries/CRUtilities.php                   |  756 +++---
 app/libraries/CommonUtilities.php               |  246 ++
 app/libraries/ExperimentUtilities.php           |  965 ++++++++
 app/libraries/ProjectUtilities.php              |  282 +++
 app/libraries/Utilities.php                     | 2145 ------------------
 app/models/Constant.php                         |   48 -
 app/models/User.php                             |   25 -
 app/routes.php                                  |   26 +-
 app/views/account/create.blade.php              |   53 +-
 app/views/account/forgot-password.blade.php     |   17 +-
 app/views/account/login.blade.php               |   69 +-
 app/views/admin/dashboard.blade.php             |   97 +-
 app/views/admin/manage-admin.blade.php          |  315 +--
 app/views/admin/manage-credentials.blade.php    |  276 +--
 app/views/admin/manage-experiments.blade.php    |  766 ++++---
 app/views/admin/manage-gateway.blade.php        |  235 +-
 app/views/admin/manage-resources.blade.php      |  101 +-
 app/views/admin/manage-roles.blade.php          |  223 +-
 app/views/admin/manage-users.blade.php          |  255 ++-
 app/views/application/deployment.blade.php      |  343 +--
 app/views/application/interface.blade.php       |  290 +--
 app/views/application/module.blade.php          |  375 +--
 app/views/emails/auth/reminder.blade.php        |   20 +-
 app/views/experiment/browse.blade.php           |  222 +-
 app/views/experiment/create-complete.blade.php  |   51 +-
 app/views/experiment/create.blade.php           |   22 +-
 app/views/experiment/edit.blade.php             |   63 +-
 app/views/experiment/search.blade.php           |  367 ++-
 app/views/experiment/summary.blade.php          |   41 +-
 app/views/gateway/browse.blade.php              |  394 ++--
 app/views/gateway/create.blade.php              |   43 +-
 app/views/home.blade.php                        |   95 +-
 app/views/layout/basic.blade.php                |  154 +-
 app/views/partials/dashboard-block.blade.php    |  102 +-
 app/views/partials/deployment-block.blade.php   |  197 +-
 app/views/partials/experiment-info.blade.php    |   39 +-
 app/views/partials/experiment-inputs.blade.php  |  100 +-
 .../partials/experiment-queue-block.blade.php   |  192 +-
 .../partials/gateway-preferences.blade.php      |  147 +-
 app/views/partials/interface-block.blade.php    |   95 +-
 .../partials/interface-input-block.blade.php    |  216 +-
 .../partials/interface-output-block.blade.php   |  181 +-
 app/views/partials/module-block.blade.php       |   28 +-
 app/views/partials/queue-block.blade.php        |   35 +-
 app/views/project/browse.blade.php              |  165 +-
 app/views/project/create.blade.php              |   44 +-
 app/views/project/edit.blade.php                |   16 +-
 app/views/project/search.blade.php              |  204 +-
 app/views/project/summary.blade.php             |   29 +-
 app/views/resource/browse.blade.php             |  245 +-
 app/views/resource/create-step3.blade.php       |   31 +-
 app/views/resource/create.blade.php             |   61 +-
 app/views/resource/edit.blade.php               | 1355 +++++------
 app/views/resource/view.blade.php               |    0
 app/views/scigap-admin/manage-gateway.blade.php |  247 +-
 app/views/server-down.blade.php                 |   11 +-
 composer.json                                   |   67 +-
 67 files changed, 7599 insertions(+), 7927 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/config/pga_config.php
----------------------------------------------------------------------
diff --git a/app/config/pga_config.php b/app/config/pga_config.php
index 48599b2..56f5fcb 100644
--- a/app/config/pga_config.php
+++ b/app/config/pga_config.php
@@ -92,6 +92,11 @@ return array(
         'server-allowed-file-size' => 64,
 
         /**
+         * directory in the web server where experiment data is staged. This path should be a relative path from app root
+         */
+        'experiment-data-root' => '/../experimentData/',
+
+        /**
          * Advanced experiments options
          */
         'advanced-experiment-options' => '',

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 85ffd1d..91280c6 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -1,29 +1,30 @@
 <?php
 
-class AccountController extends BaseController {
-
-	public function createAccountView()
-	{
-		return View::make('account/create');
-	}
-
-	public function createAccountSubmit()
-	{
-		$rules = array(
-				"username" => "required|min:6",
-				"password" => "required|min:6",
-				"confirm_password" => "required|same:password",
-				"email" => "required",
-		);
-
-		$validator = Validator::make( Input::all(), $rules);
-		if( $validator->fails()){
-			$messages = $validator->messages();
-
-			return Redirect::to("create")
-										->withInput(Input::except('password', 'password_confirm'))
-										->withErrors( $validator);
-		}
+class AccountController extends BaseController
+{
+
+    public function createAccountView()
+    {
+        return View::make('account/create');
+    }
+
+    public function createAccountSubmit()
+    {
+        $rules = array(
+            "username" => "required|min:6",
+            "password" => "required|min:6",
+            "confirm_password" => "required|same:password",
+            "email" => "required",
+        );
+
+        $validator = Validator::make(Input::all(), $rules);
+        if ($validator->fails()) {
+            $messages = $validator->messages();
+
+            return Redirect::to("create")
+                ->withInput(Input::except('password', 'password_confirm'))
+                ->withErrors($validator);
+        }
 
         $first_name = $_POST['first_name'];
         $last_name = $_POST['last_name'];
@@ -40,60 +41,62 @@ class AccountController extends BaseController {
         $url = $_POST['url'];
 
         if (WSIS::usernameExists($username)) {
-        	return Redirect::to("create")
-										->withInput(Input::except('password', 'password_confirm'))
-										->with("username_exists", true);
-		}
-        else{
+            return Redirect::to("create")
+                ->withInput(Input::except('password', 'password_confirm'))
+                ->with("username_exists", true);
+        } else {
             WSIS::addUser($username, $password, $first_name, $last_name, $email, $organization,
-            $address, $country,$telephone, $mobile, $im, $url);
-            Utilities::print_success_message('New user created!');
+                $address, $country, $telephone, $mobile, $im, $url);
+            CommonUtilities::print_success_message('New user created!');
 
             return View::make('home');
-		}
-	}
+        }
+    }
 
-	public function loginView(){
-		return View::make('account/login');
-	}
+    public function loginView()
+    {
+        return View::make('account/login');
+    }
 
-	public function loginSubmit(){
+    public function loginSubmit()
+    {
 
-        if ( Utilities::form_submitted() ) {
+        if (CommonUtilities::form_submitted()) {
             $username = $_POST['username'];
             $password = $_POST['password'];
             try {
                 if (WSIS::authenticate($username, $password)) {
-                    if( in_array(Config::get('pga_config.wsis')['admin-role-name'], (array)WSIS::getUserRoles($username)))
-                    {
+                    if (in_array(Config::get('pga_config.wsis')['admin-role-name'], (array)WSIS::getUserRoles($username))) {
                         Session::put("admin", true);
                     }
 
-                    Utilities::store_id_in_session($username);
-                    Utilities::print_success_message('Login successful! You will be redirected to your home page shortly.');
-                	Session::put("gateway_id", Config::get('pga_config.wsis')['gateway-id']);
-                	//TODO::If this option is not safe, have to find a better method to send credentials to identity server on every connection.
-                	Session::put("password", $_POST["password"]);
-                	
-                	return Redirect::to( "home");
+                    CommonUtilities::store_id_in_session($username);
+                    CommonUtilities::print_success_message('Login successful! You will be redirected to your home page shortly.');
+                    Session::put("gateway_id", Config::get('pga_config.wsis')['gateway-id']);
+                    //TODO::If this option is not safe, have to find a better method to send credentials to identity server on every connection.
+                    Session::put("password", $_POST["password"]);
+
+                    return Redirect::to("home");
 
                 } else {
-                	return Redirect::to("login")->with("invalid-credentials", true); 
+                    return Redirect::to("login")->with("invalid-credentials", true);
                 }
             } catch (Exception $ex) {
-                return Redirect::to("login")->with("invalid-credentials", true); 
+                return Redirect::to("login")->with("invalid-credentials", true);
             }
         }
 
-	}
+    }
+
+    public function forgotPassword()
+    {
+        return View::make("account/forgot-password");
+    }
 
-	public function forgotPassword(){
-		return View::make("account/forgot-password");
-	}
+    public function logout()
+    {
+        Session::flush();
+        return Redirect::to('home');
+    }
 
-	public function logout(){
-		Session::flush();
-		return Redirect::to('home');
-	}
-	
 }

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/controllers/ComputeResource.php
----------------------------------------------------------------------
diff --git a/app/controllers/ComputeResource.php b/app/controllers/ComputeResource.php
index 6644c73..e3295bb 100755
--- a/app/controllers/ComputeResource.php
+++ b/app/controllers/ComputeResource.php
@@ -1,238 +1,211 @@
 <?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
-												));
-
-	}
+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 = AppUtilities::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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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/2fbd9289/app/controllers/ExperimentController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index cb2c1f3..60561de 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -1,6 +1,7 @@
- <?php
+<?php
 
-class ExperimentController extends BaseController {
+class ExperimentController extends BaseController
+{
 
     /**
      * Limit used in fetching paginated results
@@ -8,301 +9,277 @@ class ExperimentController extends BaseController {
      */
     var $limit = 10;
 
-	/**
-	*    Instantiate a new ExperimentController Instance
-	**/
-
-	public function __construct()
-	{
-		$this->beforeFilter('verifylogin');
-		Session::put("nav-active", "experiment");
-	}
-
-	public function createView()
-	{
-		Session::forget( 'exp_create_continue');
-		return View::make('experiment/create');
-	}
-
-	public function createSubmit()
-	{
-		$inputs = Input::all();
-
-		if( isset( $_POST['continue'] ))
-		{
-			Session::put( 'exp_create_continue', true);
-			
-			$computeResources = Utilities::create_compute_resources_select($_POST['application'], null);
-
-			$queueDefaults = array( "queueName" => Config::get('pga_config.airavata')["queue-name"],
-						        	"nodeCount" => Config::get('pga_config.airavata')["node-count"],
-						        	"cpuCount" => Config::get('pga_config.airavata')["total-cpu-count"],
-						        	"wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
-							);
-
-			$experimentInputs = array( 
-								"disabled" => ' disabled',
-						        "experimentName" => $_POST['experiment-name'],
-						        "experimentDescription" => $_POST['experiment-description'] . ' ',
-						        "project" => $_POST['project'],
-						        "application" => $_POST['application'],
-						        "allowedFileSize" => Config::get('pga_config.airavata')["server-allowed-file-size"],
-						        "echo" => ($_POST['application'] == 'Echo')? ' selected' : '',
-						        "wrf" => ($_POST['application'] == 'WRF')? ' selected' : '',
-						        "queueDefaults" => $queueDefaults,
-						        "advancedOptions" => Config::get('pga_config.airavata')["advanced-experiment-options"],
-						        "computeResources" => $computeResources,
-						        "resourceHostId" => null,
-						        "advancedOptions" => Config::get('pga_config.airavata')["advanced-experiment-options"]
-					        );
-
-			return View::make( "experiment/create-complete", array( "expInputs" => $experimentInputs) );
-		}
-
-		else if (isset($_POST['save']) || isset($_POST['launch']))
-		{
-		    $expId = Utilities::create_experiment();
-
-		    if (isset($_POST['launch']) && $expId)
-		    {
-		        Utilities::launch_experiment($expId);
-		    }
-		    /* Not required.
-		    else
-		    {
-		        Utilities::print_success_message("<p>Experiment {$_POST['experiment-name']} created!</p>" .
-		            '<p>You will be redirected to the summary page shortly, or you can
-		            <a href=' . URL::to('/') . '"/experiment/summary?expId=' . $expId . '">go directly</a> to experiment summary page.</p>');
-		        
-		    }*/
-        	return Redirect::to('experiment/summary?expId=' . $expId);
-		}
-		else
-			return Redirect::to("home")->with("message", "Something went wrong here. Please file a bug report using the link in the Help menu.");
-	}
-
-	public function summary()
-	{
-		$experiment = Utilities::get_experiment($_GET['expId']);
-		if( $experiment != null)
-		{
-			$project = Utilities::get_project($experiment->projectID);
-			$expVal = Utilities::get_experiment_values( $experiment, $project);
-			$jobDetails = Utilities::get_job_details( $experiment->experimentID);
-			$transferDetails = Utilities::get_transfer_details( $experiment->experimentID);
-			//var_dump( $jobDetails); exit;
-			// User should not clone or edit a failed experiment. Only create clones of it.
-			if( $expVal["experimentStatusString"] == "FAILED")
-				$expVal["editable"] = false;
-
-			$expVal["cancelable"] = false;
-			if( $expVal["experimentStatusString"] == "LAUNCHED" || $expVal["experimentStatusString"] == "EXECUTING" )
-				$expVal["cancelable"] = true;
-
-			$data = array(
-										"expId" => Input::get("expId"),
-										"experiment" => $experiment,
-										"project" => $project,
-										"jobDetails" => $jobDetails,
-										"expVal" => $expVal
-						);
-
-			if( Request::ajax() )
-			{
-				//admin wants to see an experiment summary
-				if( Input::has("dashboard"))
-				{
-					$data["dashboard"] = true;
-					return View::make("partials/experiment-info", $data);
-				}
-				else
-					return json_encode( $experiment);
-			}
-			else
-			{
-				return View::make( "experiment/summary", $data);
-			}
-		}
-		else
-		{
-			if( Input::has("dashboard"))
-				return View::make( "partials/experiment-info", array("invalidExperimentId" => 1)); 
-			else
-				return View::make( "experiment/summary", array("invalidExperimentId" => 1));
-		}
-	}
-
-	public function expCancel()
-	{
-		Utilities::cancel_experiment( Input::get("expId"));
-
-		return Redirect::to('experiment/summary?expId=' . Input::get("expId"));
-	}
-
-	public function expChange()
-	{
-		//var_dump( Input::all() ); exit;
-		$experiment = Utilities::get_experiment( Input::get('expId') );
-		$project = Utilities::get_project($experiment->projectID);
-
-		$expVal = Utilities::get_experiment_values( $experiment, $project);
-		/*if (isset($_POST['save']))
-		{
-		    $updatedExperiment = Utilities::apply_changes_to_experiment($experiment);
-
-		    Utilities::update_experiment($experiment->experimentID, $updatedExperiment);
-		}*/
-		if (isset($_POST['launch']))
-		{
-		    Utilities::launch_experiment($experiment->experimentID);
-			return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
-		}
-		elseif (isset($_POST['clone']))
-		{
-		    $cloneId = Utilities::clone_experiment($experiment->experimentID);
-		    $experiment = Utilities::get_experiment( $cloneId );
-			$project = Utilities::get_project($experiment->projectID);
-
-			$expVal = Utilities::get_experiment_values( $experiment, $project);
-
-			return Redirect::to('experiment/edit?expId=' . $experiment->experimentID);
-
-		}
-		
-		elseif (isset($_POST['cancel']))
-		{
-		    Utilities::cancel_experiment($experiment->experimentID);
-			return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
-
-		}
-	}
-
-	public function editView()
-	{
-		$queueDefaults = array( "queueName" => Config::get('pga_config.airavata')["queue-name"],
-						        "nodeCount" => Config::get('pga_config.airavata')["node-count"],
-						        "cpuCount" => Config::get('pga_config.airavata')["total-cpu-count"],
-						        "wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
-							);
-
-		$experiment = Utilities::get_experiment($_GET['expId']);
-		$project = Utilities::get_project($experiment->projectID);
-
-		$expVal = Utilities::get_experiment_values( $experiment, $project);
-		//var_dump( $expVal); exit;
-		$computeResources = Utilities::create_compute_resources_select($experiment->applicationId, $expVal['scheduling']->resourceHostId);
-
-		$experimentInputs = array(	
-								"disabled" => ' ',
-						        "experimentName" => $experiment->name,
-						        "experimentDescription" => $experiment->description,
-						        "application" => $experiment->applicationId,
-						      	"allowedFileSize" => Config::get('pga_config.airavata')["server-allowed-file-size"],
-								'experiment' => $experiment,
-								"queueDefaults" => $queueDefaults,
-								'project' => $project,
-								'expVal' => $expVal,
-								'cloning' => true,
-						        'advancedOptions' => Config::get('pga_config.airavata')["advanced-experiment-options"],
-						        'computeResources' => $computeResources,
-						        "resourceHostId" => $expVal['scheduling']->resourceHostId,
-								'project' => $project,
-								'expVal' => $expVal,
-								'cloning' => true,
-						        'advancedOptions' => Config::get('pga_config.airavata')["advanced-experiment-options"]
-								);
-		return View::make("experiment/edit", array("expInputs" => $experimentInputs) );
-	}
-
-	public function editSubmit()
-	{
-		if (isset($_POST['save']) || isset($_POST['launch']))
-		{
-	        $experiment = Utilities::get_experiment(Input::get('expId') ); // update local experiment variable
-		    $updatedExperiment = Utilities::apply_changes_to_experiment($experiment, Input::all() );
-
-		    Utilities::update_experiment($experiment->experimentID, $updatedExperiment);
-
-		    if (isset($_POST['save']))
-		    {
-		        $experiment = Utilities::get_experiment(Input::get('expId') ); // update local experiment variable
-		    }
-		    if (isset($_POST['launch']))
-		    {
-		        Utilities::launch_experiment($experiment->experimentID);
-		    }
-
-			return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
-		}
-		else
-			return View::make("home");
-	}
-
-	public function searchView()
-	{
-		$experimentStates = Utilities::getExpStates();
-		return View::make("experiment/search", array( "expStates" => $experimentStates ) );
-	}
-
-	public function searchSubmit()
-	{
+    /**
+     *    Instantiate a new ExperimentController Instance
+     **/
+
+    public function __construct()
+    {
+        $this->beforeFilter('verifylogin');
+        Session::put("nav-active", "experiment");
+    }
+
+    public function createView()
+    {
+        Session::forget('exp_create_continue');
+        return View::make('experiment/create');
+    }
+
+    public function createSubmit()
+    {
+        $inputs = Input::all();
+
+        if (isset($_POST['continue'])) {
+            Session::put('exp_create_continue', true);
+
+            $computeResources = CRUtilities::create_compute_resources_select($_POST['application'], null);
+
+            $queueDefaults = array("queueName" => Config::get('pga_config.airavata')["queue-name"],
+                "nodeCount" => Config::get('pga_config.airavata')["node-count"],
+                "cpuCount" => Config::get('pga_config.airavata')["total-cpu-count"],
+                "wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
+            );
+
+            $experimentInputs = array(
+                "disabled" => ' disabled',
+                "experimentName" => $_POST['experiment-name'],
+                "experimentDescription" => $_POST['experiment-description'] . ' ',
+                "project" => $_POST['project'],
+                "application" => $_POST['application'],
+                "allowedFileSize" => Config::get('pga_config.airavata')["server-allowed-file-size"],
+                "echo" => ($_POST['application'] == 'Echo') ? ' selected' : '',
+                "wrf" => ($_POST['application'] == 'WRF') ? ' selected' : '',
+                "queueDefaults" => $queueDefaults,
+                "advancedOptions" => Config::get('pga_config.airavata')["advanced-experiment-options"],
+                "computeResources" => $computeResources,
+                "resourceHostId" => null,
+                "advancedOptions" => Config::get('pga_config.airavata')["advanced-experiment-options"]
+            );
+
+            return View::make("experiment/create-complete", array("expInputs" => $experimentInputs));
+        } else if (isset($_POST['save']) || isset($_POST['launch'])) {
+            $expId = ExperimentUtilities::create_experiment();
+
+            if (isset($_POST['launch']) && $expId) {
+                ExperimentUtilities::launch_experiment($expId);
+            }
+            /* Not required.
+            else
+            {
+                Utilities::print_success_message("<p>Experiment {$_POST['experiment-name']} created!</p>" .
+                    '<p>You will be redirected to the summary page shortly, or you can
+                    <a href=' . URL::to('/') . '"/experiment/summary?expId=' . $expId . '">go directly</a> to experiment summary page.</p>');
+
+            }*/
+            return Redirect::to('experiment/summary?expId=' . $expId);
+        } else
+            return Redirect::to("home")->with("message", "Something went wrong here. Please file a bug report using the link in the Help menu.");
+    }
+
+    public function summary()
+    {
+        $experiment = ExperimentUtilities::get_experiment($_GET['expId']);
+        if ($experiment != null) {
+            $project = ProjectUtilities::get_project($experiment->projectID);
+            $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
+            $jobDetails = ExperimentUtilities::get_job_details($experiment->experimentID);
+            $transferDetails = ExperimentUtilities::get_transfer_details($experiment->experimentID);
+            //var_dump( $jobDetails); exit;
+            // User should not clone or edit a failed experiment. Only create clones of it.
+            if ($expVal["experimentStatusString"] == "FAILED")
+                $expVal["editable"] = false;
+
+            $expVal["cancelable"] = false;
+            if ($expVal["experimentStatusString"] == "LAUNCHED" || $expVal["experimentStatusString"] == "EXECUTING")
+                $expVal["cancelable"] = true;
+
+            $data = array(
+                "expId" => Input::get("expId"),
+                "experiment" => $experiment,
+                "project" => $project,
+                "jobDetails" => $jobDetails,
+                "expVal" => $expVal
+            );
+
+            if (Request::ajax()) {
+                //admin wants to see an experiment summary
+                if (Input::has("dashboard")) {
+                    $data["dashboard"] = true;
+                    return View::make("partials/experiment-info", $data);
+                } else
+                    return json_encode($experiment);
+            } else {
+                return View::make("experiment/summary", $data);
+            }
+        } else {
+            if (Input::has("dashboard"))
+                return View::make("partials/experiment-info", array("invalidExperimentId" => 1));
+            else
+                return View::make("experiment/summary", array("invalidExperimentId" => 1));
+        }
+    }
+
+    public function expCancel()
+    {
+        ExperimentUtilities::cancel_experiment(Input::get("expId"));
+
+        return Redirect::to('experiment/summary?expId=' . Input::get("expId"));
+    }
+
+    public function expChange()
+    {
+        //var_dump( Input::all() ); exit;
+        $experiment = ExperimentUtilities::get_experiment(Input::get('expId'));
+        $project = ProjectUtilities::get_project($experiment->projectID);
+
+        $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
+        /*if (isset($_POST['save']))
+        {
+            $updatedExperiment = Utilities::apply_changes_to_experiment($experiment);
+
+            Utilities::update_experiment($experiment->experimentID, $updatedExperiment);
+        }*/
+        if (isset($_POST['launch'])) {
+            ExperimentUtilities::launch_experiment($experiment->experimentID);
+            return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
+        } elseif (isset($_POST['clone'])) {
+            $cloneId = ExperimentUtilities::clone_experiment($experiment->experimentID);
+            $experiment = ExperimentUtilities::get_experiment($cloneId);
+            $project = ProjectUtilities::get_project($experiment->projectID);
+
+            $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
+
+            return Redirect::to('experiment/edit?expId=' . $experiment->experimentID);
+
+        } elseif (isset($_POST['cancel'])) {
+            ExperimentUtilities::cancel_experiment($experiment->experimentID);
+            return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
+
+        }
+    }
+
+    public function editView()
+    {
+        $queueDefaults = array("queueName" => Config::get('pga_config.airavata')["queue-name"],
+            "nodeCount" => Config::get('pga_config.airavata')["node-count"],
+            "cpuCount" => Config::get('pga_config.airavata')["total-cpu-count"],
+            "wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
+        );
+
+        $experiment = ExperimentUtilities::get_experiment($_GET['expId']);
+        $project = ProjectUtilities::get_project($experiment->projectID);
+
+        $expVal = ExperimentUtilities::get_experiment_values($experiment, $project);
+        //var_dump( $expVal); exit;
+        $computeResources = CRUtilities::create_compute_resources_select($experiment->applicationId, $expVal['scheduling']->resourceHostId);
+
+        $experimentInputs = array(
+            "disabled" => ' ',
+            "experimentName" => $experiment->name,
+            "experimentDescription" => $experiment->description,
+            "application" => $experiment->applicationId,
+            "allowedFileSize" => Config::get('pga_config.airavata')["server-allowed-file-size"],
+            'experiment' => $experiment,
+            "queueDefaults" => $queueDefaults,
+            'project' => $project,
+            'expVal' => $expVal,
+            'cloning' => true,
+            'advancedOptions' => Config::get('pga_config.airavata')["advanced-experiment-options"],
+            'computeResources' => $computeResources,
+            "resourceHostId" => $expVal['scheduling']->resourceHostId,
+            'project' => $project,
+            'expVal' => $expVal,
+            'cloning' => true,
+            'advancedOptions' => Config::get('pga_config.airavata')["advanced-experiment-options"]
+        );
+        return View::make("experiment/edit", array("expInputs" => $experimentInputs));
+    }
+
+    public function editSubmit()
+    {
+        if (isset($_POST['save']) || isset($_POST['launch'])) {
+            $experiment = ExperimentUtilities::get_experiment(Input::get('expId')); // update local experiment variable
+            $updatedExperiment = ExperimentUtilities::apply_changes_to_experiment($experiment, Input::all());
+
+            ExperimentUtilities::update_experiment($experiment->experimentID, $updatedExperiment);
+
+            if (isset($_POST['save'])) {
+                $experiment = ExperimentUtilities::get_experiment(Input::get('expId')); // update local experiment variable
+            }
+            if (isset($_POST['launch'])) {
+                ExperimentUtilities::launch_experiment($experiment->experimentID);
+            }
+
+            return Redirect::to('experiment/summary?expId=' . $experiment->experimentID);
+        } else
+            return View::make("home");
+    }
+
+    public function searchView()
+    {
+        $experimentStates = ExperimentUtilities::getExpStates();
+        return View::make("experiment/search", array("expStates" => $experimentStates));
+    }
+
+    public function searchSubmit()
+    {
         $search = Input::get('search');
-        if(isset($search)){
+        if (isset($search)) {
             $pageNo = 1;
-        }else{
+        } else {
             $pageNo = Input::get('pageNo');
             $prev = Input::get('prev');
-            if(empty($pageNo)){
+            if (empty($pageNo)) {
                 $pageNo = 1;
-            }else{
-                if(isset($prev)){
+            } else {
+                if (isset($prev)) {
                     $pageNo -= 1;
-                }else{
+                } else {
                     $pageNo += 1;
                 }
             }
         }
 
-        $expContainer = Utilities::get_expsearch_results_with_pagination( Input::all(), $this->limit,
-            ($pageNo-1)*$this->limit);
-
-		$experimentStates = Utilities::getExpStates();
-		return View::make('experiment/search', array(
-                                                    'input' => Input::all(),
-                                                    'pageNo' => $pageNo,
-                                                    'limit' => $this->limit,
-													'expStates' => $experimentStates,
-													'expContainer' => $expContainer 
-												));
-	}
-
-	public function getQueueView()
-	{
-		$queues = Utilities::getQueueDatafromResourceId( Input::get("crId"));
-		$queueDefaults = array( "queueName" => Config::get('pga_config.airavata')["queue-name"],
-						        "nodeCount" => Config::get('pga_config.airavata')["node-count"],
-						        "cpuCount" => Config::get('pga_config.airavata')["total-cpu-count"],
-						        "wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
-							);
-		return View::make("partials/experiment-queue-block", array( "queues" => $queues, "queueDefaults" => $queueDefaults) );
-	}
+        $expContainer = ExperimentUtilities::get_expsearch_results_with_pagination(Input::all(), $this->limit,
+            ($pageNo - 1) * $this->limit);
+
+        $experimentStates = CommonUtilities::getExpStates();
+        return View::make('experiment/search', array(
+            'input' => Input::all(),
+            'pageNo' => $pageNo,
+            'limit' => $this->limit,
+            'expStates' => $experimentStates,
+            'expContainer' => $expContainer
+        ));
+    }
+
+    public function getQueueView()
+    {
+        $queues = ExperimentUtilities::getQueueDatafromResourceId(Input::get("crId"));
+        $queueDefaults = array("queueName" => Config::get('pga_config.airavata')["queue-name"],
+            "nodeCount" => Config::get('pga_config.airavata')["node-count"],
+            "cpuCount" => Config::get('pga_config.airavata')["total-cpu-count"],
+            "wallTimeLimit" => Config::get('pga_config.airavata')["wall-time-limit"]
+        );
+        return View::make("partials/experiment-queue-block", array("queues" => $queues, "queueDefaults" => $queueDefaults));
+    }
 
     public function browseView()
     {
         $pageNo = Input::get('pageNo');
         $prev = Input::get('prev');
-        if(empty($pageNo)){
+        if (empty($pageNo)) {
             $pageNo = 1;
-        }else{
-            if(isset($prev)){
+        } else {
+            if (isset($prev)) {
                 $pageNo -= 1;
-            }else{
+            } else {
                 $pageNo += 1;
             }
         }
 
-        $expContainer = Utilities::get_all_user_experiments_with_pagination($this->limit, ($pageNo-1)*$this->limit);
-        $experimentStates = Utilities::getExpStates();
+        $expContainer = ExperimentUtilities::get_all_user_experiments_with_pagination($this->limit, ($pageNo - 1) * $this->limit);
+        $experimentStates = ExperimentUtilities::getExpStates();
         return View::make('experiment/browse', array(
             'pageNo' => $pageNo,
             'limit' => $this->limit,
@@ -311,4 +288,5 @@ class ExperimentController extends BaseController {
         ));
     }
 }
+
 ?>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/controllers/ProjectController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ProjectController.php b/app/controllers/ProjectController.php
index 973227a..b455bb3 100755
--- a/app/controllers/ProjectController.php
+++ b/app/controllers/ProjectController.php
@@ -1,6 +1,7 @@
 <?php
 
-class ProjectController extends BaseController {
+class ProjectController extends BaseController
+{
 
     /**
      * Limit used in fetching paginated results
@@ -8,122 +9,114 @@ class ProjectController extends BaseController {
      */
     var $limit = 20;
 
-	/**
-	*    Instantiate a new ProjectController Instance
-	**/
+    /**
+     *    Instantiate a new ProjectController Instance
+     **/
 
-	public function __construct()
-	{
-		$this->beforeFilter('verifylogin');
-		Session::put("nav-active", "project");
+    public function __construct()
+    {
+        $this->beforeFilter('verifylogin');
+        Session::put("nav-active", "project");
 
-	}
+    }
 
-	public function createView()
-	{
-		return View::make("project/create");
-	}
+    public function createView()
+    {
+        return View::make("project/create");
+    }
 
-	public function createSubmit()
-	{
-		if (isset($_POST['save']))
-		{
-			$projectId = Utilities::create_project();
+    public function createSubmit()
+    {
+        if (isset($_POST['save'])) {
+            $projectId = ProjectUtilities::create_project();
             return Redirect::to('project/summary?projId=' . $projectId);
-		}
-		else
-		{
-			return Redirect::to('project/create');
-		}
-	}
-
-	public function summary()
-	{
-		if( Input::has("projId"))
-		{
-			Session::put("projId", Input::get("projId"));
-			return View::make("project/summary", 
-					array( "projectId" => Input::get("projId")) );
-		}
-		else
-			return Redirect::to("home");
-	}
-
-	public function editView()
-	{
-		if( Input::has("projId"))
-		{
-			return View::make("project/edit", 
-					array( "projectId" => Input::get("projId"),
-							"project" => Utilities::get_project($_GET['projId']) 
-						 ) );
-		}
-		else
-			return Redirect::to("home");
-	}
-
-	public function editSubmit()
-	{
-		if (isset($_POST['save']))
-	    {
-	    	$projectDetails["owner"] = Session::get("username");
-	    	$projectDetails["name"] = Input::get("project-name");
-	    	$projectDetails["description"] = Input::get("project-description");
-
-	        Utilities::update_project( Input::get("projectId"), $projectDetails);
-
-	        return Redirect::to("project/summary?projId=" . Input::get("projectId") )->with("project_edited", true);
-	    }
-	}
-
-	public function searchView()
-	{
-		return View::make('project/search');
-	}
-
-	public function searchSubmit()
-	{
+        } else {
+            return Redirect::to('project/create');
+        }
+    }
+
+    public function summary()
+    {
+        if (Input::has("projId")) {
+            Session::put("projId", Input::get("projId"));
+            return View::make("project/summary",
+                array("projectId" => Input::get("projId")));
+        } else
+            return Redirect::to("home");
+    }
+
+    public function editView()
+    {
+        if (Input::has("projId")) {
+            return View::make("project/edit",
+                array("projectId" => Input::get("projId"),
+                    "project" => ProjectUtilities::get_project($_GET['projId'])
+                ));
+        } else
+            return Redirect::to("home");
+    }
+
+    public function editSubmit()
+    {
+        if (isset($_POST['save'])) {
+            $projectDetails["owner"] = Session::get("username");
+            $projectDetails["name"] = Input::get("project-name");
+            $projectDetails["description"] = Input::get("project-description");
+
+            ProjectUtilities::update_project(Input::get("projectId"), $projectDetails);
+
+            return Redirect::to("project/summary?projId=" . Input::get("projectId"))->with("project_edited", true);
+        }
+    }
+
+    public function searchView()
+    {
+        return View::make('project/search');
+    }
+
+    public function searchSubmit()
+    {
         $search = Input::get('search');
-        if(isset($search)){
+        if (isset($search)) {
             $pageNo = 1;
-        }else{
+        } else {
             $pageNo = Input::get('pageNo');
             $prev = Input::get('prev');
-            if(empty($pageNo)){
+            if (empty($pageNo)) {
                 $pageNo = 1;
-            }else{
-                if(isset($prev)){
+            } else {
+                if (isset($prev)) {
                     $pageNo -= 1;
-                }else{
+                } else {
                     $pageNo += 1;
                 }
             }
         }
 
-        $projects = Utilities::get_projsearch_results_with_pagination( Input::get("search-key"),
-            Input::get("search-value"), $this->limit, ($pageNo-1)*$this->limit);
-		return View::make( 'project/search', array(
-            'pageNo' => $pageNo,
-            'limit' => $this->limit,
-            'projects' => $projects)
+        $projects = ProjectUtilities::get_projsearch_results_with_pagination(Input::get("search-key"),
+            Input::get("search-value"), $this->limit, ($pageNo - 1) * $this->limit);
+        return View::make('project/search', array(
+                'pageNo' => $pageNo,
+                'limit' => $this->limit,
+                'projects' => $projects)
         );
-	}
+    }
 
     public function browseView()
     {
         $pageNo = Input::get('pageNo');
         $prev = Input::get('prev');
-        if(empty($pageNo)){
+        if (empty($pageNo)) {
             $pageNo = 1;
-        }else{
-            if(isset($prev)){
+        } else {
+            if (isset($prev)) {
                 $pageNo -= 1;
-            }else{
+            } else {
                 $pageNo += 1;
             }
         }
 
-        $projects = Utilities::get_all_user_projects_with_pagination( $this->limit, ($pageNo-1)*$this->limit);
+        $projects = ProjectUtilities::get_all_user_projects_with_pagination($this->limit, ($pageNo - 1) * $this->limit);
         return View::make('project/browse', array(
             'pageNo' => $pageNo,
             'limit' => $this->limit,

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/controllers/ResourceController.php
----------------------------------------------------------------------
diff --git a/app/controllers/ResourceController.php b/app/controllers/ResourceController.php
index d11d918..41eddcb 100755
--- a/app/controllers/ResourceController.php
+++ b/app/controllers/ResourceController.php
@@ -1,238 +1,211 @@
 <?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
-												));
-
-	}
+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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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 = CRUtilities::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/2fbd9289/app/filters.php
----------------------------------------------------------------------
diff --git a/app/filters.php b/app/filters.php
index 409e642..eeea00c 100755
--- a/app/filters.php
+++ b/app/filters.php
@@ -11,20 +11,18 @@
 |
 */
 
-App::before(function($request)
-{
+App::before(function ($request) {
     $authzToken = new Airavata\Model\Security\AuthzToken();
     $authzToken->accessToken = "emptyToken";
     $apiVersion = Airavata::getAPIVersion($authzToken);
-	if(empty($apiVersion))
-		return View::make("server-down");
+    if (empty($apiVersion))
+        return View::make("server-down");
 });
 
 
-App::after(function($request, $response)
-{
-	//
-	// Test commit.
+App::after(function ($request, $response) {
+    //
+    // Test commit.
 });
 
 /*
@@ -38,25 +36,19 @@ App::after(function($request, $response)
 |
 */
 
-Route::filter('auth', function()
-{
-	if (Auth::guest())
-	{
-		if (Request::ajax())
-		{
-			return Response::make('Unauthorized', 401);
-		}
-		else
-		{
-			return Redirect::guest('login');
-		}
-	}
+Route::filter('auth', function () {
+    if (Auth::guest()) {
+        if (Request::ajax()) {
+            return Response::make('Unauthorized', 401);
+        } else {
+            return Redirect::guest('login');
+        }
+    }
 });
 
 
-Route::filter('auth.basic', function()
-{
-	return Auth::basic();
+Route::filter('auth.basic', function () {
+    return Auth::basic();
 });
 
 /*
@@ -70,9 +62,8 @@ Route::filter('auth.basic', function()
 |
 */
 
-Route::filter('guest', function()
-{
-	if (Auth::check()) return Redirect::to('/');
+Route::filter('guest', function () {
+    if (Auth::check()) return Redirect::to('/');
 });
 
 /*
@@ -86,30 +77,23 @@ Route::filter('guest', function()
 |
 */
 
-Route::filter('csrf', function()
-{
-	if (Session::token() != Input::get('_token'))
-	{
-		throw new Illuminate\Session\TokenMismatchException;
-	}
+Route::filter('csrf', function () {
+    if (Session::token() != Input::get('_token')) {
+        throw new Illuminate\Session\TokenMismatchException;
+    }
 });
 
 
-Route::filter('verifylogin',function()
-{
-	if( ! Utilities::verify_login() )
-		return Redirect::to("home")->with("login-alert", true);
+Route::filter('verifylogin', function () {
+    if (!CommonUtilities::verify_login())
+        return Redirect::to("home")->with("login-alert", true);
 });
 
-Route::filter('verifyadmin', function()
-{
-	if( Utilities::verify_login() )
-	{
-		if( !Session::has("admin"))
-		{
-			return Redirect::to("home")->with("admin-alert", true);
-		}
-	} 
-	else
-		return Redirect::to("home")->with("login-alert", true);
+Route::filter('verifyadmin', function () {
+    if (CommonUtilities::verify_login()) {
+        if (!Session::has("admin")) {
+            return Redirect::to("home")->with("admin-alert", true);
+        }
+    } else
+        return Redirect::to("home")->with("login-alert", true);
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index c768874..38e4693 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -2,15 +2,17 @@
 
 use Airavata\Model\Workspace\Gateway;
 
-class AdminUtilities{
+class AdminUtilities
+{
 
-public static function addGateway( $input){
-	$gateway = new Gateway();
-	$gateway->gatewayId = $input["gatewayName"];
-	$gateway->domain = $input["domain"];
-	$gateway->gatewayName = $input["gatewayName"];
-	$gateway->emailAddress = $input["admin-email"];
-	return Airavata::addGateway( $gateway);
-}
+    public static function addGateway($input)
+    {
+        $gateway = new Gateway();
+        $gateway->gatewayId = $input["gatewayName"];
+        $gateway->domain = $input["domain"];
+        $gateway->gatewayName = $input["gatewayName"];
+        $gateway->emailAddress = $input["admin-email"];
+        return Airavata::addGateway($gateway);
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/AiravataClientFactory.php
----------------------------------------------------------------------
diff --git a/app/libraries/AiravataClientFactory.php b/app/libraries/AiravataClientFactory.php
deleted file mode 100755
index efd01a9..0000000
--- a/app/libraries/AiravataClientFactory.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace Airavata\Client;
-
-class AiravataClientFactory
-{
-
-    private $airavataServerHost;
-    private $airavataServerPort;
-
-    public function __construct($options)
-    {
-        $this->airavataServerHost = isset($options['airavataServerHost']) ? $options['airavataServerHost'] : null;
-        $this->airavataServerPort = isset($options['airavataServerPort']) ? $options['airavataServerPort'] : null;
-    }
-
-    public function getAiravataClient()
-    {
-        $transport = new TSocket($this->airavataServerHost, $this->airavataServerPort);
-        $protocol = new TBinaryProtocol($transport);
-	$transport->open();
-        return new AiravataClient($protocol);
-    }
-}


[08/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/ExperimentUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
new file mode 100644
index 0000000..6a5f0b4
--- /dev/null
+++ b/app/libraries/ExperimentUtilities.php
@@ -0,0 +1,965 @@
+<?php
+
+use Airavata\API\Error\AiravataClientException;
+use Airavata\API\Error\AiravataSystemException;
+use Airavata\API\Error\ExperimentNotFoundException;
+use Airavata\API\Error\InvalidRequestException;
+use Airavata\Facades\Airavata;
+use Airavata\Model\AppCatalog\AppInterface\DataType;
+use Airavata\Model\AppCatalog\AppInterface\InputDataObjectType;
+use Airavata\Model\Workspace\Experiment\AdvancedOutputDataHandling;
+use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
+use Airavata\Model\Workspace\Experiment\Experiment;
+use Airavata\Model\Workspace\Experiment\ExperimentState;
+use Airavata\Model\Workspace\Experiment\JobState;
+use Airavata\Model\Workspace\Experiment\UserConfigurationData;
+
+class ExperimentUtilities
+{
+
+    private $sshUser;
+    private $hostName;
+    private static $pathConstant;
+    private static $experimentPath;
+    private static $experimentDataPathAbsolute;
+
+    function __construct()
+    {
+        $this->sshUser = "root";
+        $this->hostName = $_SERVER['SERVER_NAME'];
+
+        self::$experimentDataPathAbsolute = base_path() . Config::get('pga_config.airavata')['experiment-data-root'];
+        self::$pathConstant = 'file://' . $this->sshUser . '@' . $this->hostName . ':' . self::$experimentDataPathAbsolute;
+        self::$experimentPath = null;
+    }
+
+    /**
+     * Launch the experiment with the given ID
+     * @param $expId
+     */
+    public static function launch_experiment($expId)
+    {
+        try {
+            $hardCodedToken = Config::get('pga_config.airavata')['credential-store-token'];
+            Airavata::launchExperiment($expId, $hardCodedToken);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem launching the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (ExperimentNotFoundException $enf) {
+            CommonUtilities::print_error_message('<p>There was a problem launching the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem launching the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem launching the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
+        } catch (Exception $e) {
+            CommonUtilities::print_error_message('<p>There was a problem launching the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Exception: ' . $e->getMessage() . '</p>');
+        }
+    }
+
+    /**
+     * List the experiment's input files
+     * @param $experiment
+     */
+    public static function list_input_files($experiment)
+    {
+        $applicationInputs = AppUtilities::get_application_inputs($experiment->applicationId);
+
+        $experimentInputs = $experiment->experimentInputs;
+
+
+        //showing experiment inputs in the order defined by the admins.
+        $order = array();
+        foreach ($experimentInputs as $index => $input) {
+            $order[$index] = $input->inputOrder;
+        }
+        array_multisort($order, SORT_ASC, $experimentInputs);
+
+        foreach ($experimentInputs as $input) {
+            $matchingAppInput = null;
+
+            foreach ($applicationInputs as $applicationInput) {
+                if ($input->name == $applicationInput->name) {
+                    $matchingAppInput = $applicationInput;
+                }
+            }
+            //var_dump($matchingAppInput);
+
+            if ($matchingAppInput->type == DataType::URI) {
+                $explode = explode('/', $input->value);
+                echo '<p><a target="_blank"
+                        href="' . URL::to("/") . "/../../" . Config::get('pga_config.airavata')['experiment-data-root'] . $explode[sizeof($explode) - 2] . '/' . $explode[sizeof($explode) - 1] . '">' .
+                    $explode[sizeof($explode) - 1] . '
+                <span class="glyphicon glyphicon-new-window"></span></a></p>';
+            } elseif ($matchingAppInput->type == DataType::STRING) {
+                echo '<p>' . $input->name . ': ' . $input->value . '</p>';
+            }
+        }
+    }
+
+    /**
+     * Get the experiment with the given ID
+     * @param $expId
+     * @return null
+     */
+    public static function get_experiment($expId)
+    {
+
+        try {
+            return Airavata::getExperiment($expId);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (ExperimentNotFoundException $enf) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>TTransportException: ' . $tte->getMessage() . '</p>');
+        } catch (Exception $e) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Exception: ' . $e->getMessage() . '</p>');
+        }
+
+    }
+
+    /**
+     * Create and configure a new Experiment
+     * @return Experiment
+     */
+    public static function assemble_experiment()
+    {
+        $experimentInputs = array();
+
+        $scheduling = new ComputationalResourceScheduling();
+        $scheduling->totalCPUCount = $_POST['cpu-count'];
+        $scheduling->nodeCount = $_POST['node-count'];
+        $scheduling->queueName = $_POST['queue-name'];
+        $scheduling->wallTimeLimit = $_POST['wall-time'];
+        $scheduling->totalPhysicalMemory = $_POST['total-physical-memory'];
+        $scheduling->resourceHostId = $_POST['compute-resource'];
+
+        $userConfigData = new UserConfigurationData();
+        $userConfigData->computationalResourceScheduling = $scheduling;
+        if (isset($_POST["userDN"])) {
+            $userConfigData->generateCert = 1;
+            $userConfigData->userDN = $_POST["userDN"];
+        }
+
+        $applicationInputs = AppUtilities::get_application_inputs($_POST['application']);
+        $experimentInputs = ExperimentUtilities::process_inputs($applicationInputs, $experimentInputs);
+
+        if (ExperimentUtilities::$experimentPath == null) {
+            ExperimentUtilities::create_experiment_folder_path();
+        }
+
+        $advHandling = new AdvancedOutputDataHandling();
+
+        $advHandling->outputDataDir = str_replace(base_path() . Config::get('pga_config.airavata')['experiment-data-root'],
+            ExperimentUtilities::$pathConstant, ExperimentUtilities::$experimentPath);
+        $userConfigData->advanceOutputDataHandling = $advHandling;
+
+        //TODO: replace constructor with a call to airvata to get a prepopulated experiment template
+        $experiment = new Experiment();
+
+        // required
+        $experiment->projectID = $_POST['project'];
+        $experiment->userName = Session::get('username');
+        $experiment->name = $_POST['experiment-name'];
+
+        // optional
+        $experiment->description = $_POST['experiment-description'];
+        $experiment->applicationId = $_POST['application'];
+        $experiment->userConfigurationData = $userConfigData;
+        $experiment->experimentInputs = $experimentInputs;
+        if (isset($_POST["enableEmailNotification"])) {
+            $experiment->enableEmailNotification = intval($_POST["enableEmailNotification"]);
+            $experiment->emailAddresses = array_unique(array_filter($_POST["emailAddresses"], "trim"));
+        }
+
+        // adding default experiment outputs for now till prepoulated experiment template is not implemented.
+        $experiment->experimentOutputs = AppUtilities::get_application_outputs($_POST["application"]);
+
+        if ($experimentInputs) {
+            return $experiment;
+        }
+    }
+
+
+    /**
+     * @param $applicationInputs
+     * @param $experimentInputs
+     * @internal param $environmentPath
+     * @return array
+     */
+    public static function process_inputs($applicationInputs, $experimentInputs)
+    {
+        $experimentAssemblySuccessful = true;
+        $newExperimentInputs = array();
+
+        //var_dump($_FILES);
+
+        if (sizeof($_FILES) > 0) {
+            if (ExperimentUtilities::file_upload_successful()) {
+                // construct unique path
+                ExperimentUtilities::create_experiment_folder_path();
+            } else {
+                $experimentAssemblySuccessful = false;
+            }
+        }
+
+        //sending application inputs in the order defined by the admins.
+        $order = array();
+        foreach ($applicationInputs as $index => $input) {
+            $order[$index] = $input->inputOrder;
+        }
+        array_multisort($order, SORT_ASC, $applicationInputs);
+
+        foreach ($applicationInputs as $applicationInput) {
+            $experimentInput = new InputDataObjectType();
+            $experimentInput = $applicationInput;
+            //$experimentInput->name = $applicationInput->name;
+            //$experimentInput->metaData = $applicationInput->metaData;
+
+
+            //$experimentInput->type = $applicationInput->type;
+            //$experimentInput->type = DataType::STRING;
+
+
+            if (($applicationInput->type == DataType::STRING) ||
+                ($applicationInput->type == DataType::INTEGER) ||
+                ($applicationInput->type == DataType::FLOAT)
+            ) {
+                if (isset($_POST[$applicationInput->name]) && (trim($_POST[$applicationInput->name]) != '')) {
+                    $experimentInput->value = $_POST[$applicationInput->name];
+                    $experimentInput->type = $applicationInput->type;
+
+                } else // use previous value
+                {
+                    $index = -1;
+                    for ($i = 0; $i < sizeof($experimentInputs); $i++) {
+                        if ($experimentInputs[$i]->name == $applicationInput->name) {
+                            $index = $i;
+                        }
+                    }
+
+                    if ($index >= 0) {
+                        $experimentInput->value = $experimentInputs[$index]->value;
+                        $experimentInput->type = $applicationInput->type;
+                    }
+                }
+            } elseif ($applicationInput->type == DataType::URI) {
+                //var_dump($_FILES[$applicationInput->name]->name);
+                if ($_FILES[$applicationInput->name]['name']) {
+                    $file = $_FILES[$applicationInput->name];
+
+
+                    //
+                    // move file to experiment data directory
+                    //
+                    $filePath = ExperimentUtilities::$experimentPath . $file['name'];
+
+                    // check if file already exists
+                    if (is_file($filePath)) {
+                        unlink($filePath);
+
+                        CommonUtilities::print_warning_message('Uploaded file already exists! Overwriting...');
+                    }
+
+                    $moveFile = move_uploaded_file($file['tmp_name'], $filePath);
+
+                    if ($moveFile) {
+                        CommonUtilities::print_success_message('Upload: ' . $file['name'] . '<br>' .
+                            'Type: ' . $file['type'] . '<br>' .
+                            'Size: ' . ($file['size'] / 1024) . ' kB');
+                        //<br>' .
+                        //'Stored in: ' . $experimentPath . $file['name']);
+                    } else {
+                        CommonUtilities::print_error_message('<p>Error moving uploaded file ' . $file['name'] . '!
+                    Please try again later or report a bug using the link in the Help menu.</p>');
+                        $experimentAssemblySuccessful = false;
+                    }
+
+                    $experimentInput->value = str_replace(base_path() . Config::get('pga_config.airavata')['experiment-data-root'], CommonUtilities::$pathConstant, $filePath);
+                    $experimentInput->type = $applicationInput->type;
+
+                } else {
+                    $index = -1;
+                    for ($i = 0; $i < sizeof($experimentInputs); $i++) {
+                        if ($experimentInputs[$i]->name == $applicationInput->name) {
+                            $index = $i;
+                        }
+                    }
+
+                    if ($index >= 0) {
+                        $experimentInput->value = $experimentInputs[$index]->value;
+                        $experimentInput->type = $applicationInput->type;
+                    }
+                }
+
+            } else {
+                CommonUtilities::print_error_message('I cannot accept this input type yet!');
+            }
+
+            $newExperimentInputs[] = $experimentInput;
+
+        }
+
+        if ($experimentAssemblySuccessful) {
+            return $newExperimentInputs;
+        } else {
+            return false;
+        }
+    }
+
+
+    public static function create_experiment_folder_path()
+    {
+        do {
+            ExperimentUtilities::$experimentPath = base_path() . Config::get('pga_config.airavata')['experiment-data-root'] . str_replace(' ', '', Session::get('username')) . md5(rand() * time()) . '/';
+        } while (is_dir(ExperimentUtilities::$experimentPath)); // if dir already exists, try again
+        // create upload directory
+        if (!mkdir(ExperimentUtilities::$experimentPath)) {
+            CommonUtilities::print_error_message('<p>Error creating upload directory!
+            Please try again later or report a bug using the link in the Help menu.</p>');
+            $experimentAssemblySuccessful = false;
+        }
+    }
+
+    /**
+     * Check the uploaded files for errors
+     */
+    public static function file_upload_successful()
+    {
+        $uploadSuccessful = true;
+
+        foreach ($_FILES as $file) {
+            //var_dump($file);
+            if ($file['name']) {
+                if ($file['error'] > 0) {
+                    $uploadSuccessful = false;
+                    CommonUtilities::print_error_message('<p>Error uploading file ' . $file['name'] . ' !
+                    Please try again later or report a bug using the link in the Help menu.');
+                }
+            }
+
+
+        }
+
+        return $uploadSuccessful;
+    }
+
+
+    /**
+     * Update the experiment with the given ID
+     * @param $expId
+     * @param $updatedExperiment
+     */
+    public static function update_experiment($expId, $updatedExperiment)
+    {
+        try {
+            Airavata::updateExperiment($expId, $updatedExperiment);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem updating the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (ExperimentNotFoundException $enf) {
+            CommonUtilities::print_error_message('<p>There was a problem updating the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem updating the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem updating the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
+        }
+    }
+
+
+    /**
+     * Clone the experiment with the given ID
+     * @param $expId
+     */
+    public static function clone_experiment($expId)
+    {
+        try {
+            //create new experiment to receive the clone
+            $experiment = Airavata::getExperiment($expId);
+
+            $cloneId = Airavata::cloneExperiment($expId, 'Clone of ' . $experiment->name);
+
+            CommonUtilities::print_success_message("<p>Experiment cloned!</p>" .
+                '<p>You will be redirected to the edit page shortly, or you can
+                <a href="edit_experiment.php?expId=' . $cloneId . '">go directly</a> to the edit experiment page.</p>');
+            //redirect('edit_experiment.php?expId=' . $cloneId);
+            return $cloneId;
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem cloning the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (ExperimentNotFoundException $enf) {
+            CommonUtilities::print_error_message('<p>There was a problem cloning the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem cloning the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem cloning the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('<p>There was a problem cloning the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>TTransportException: ' . $tte->getMessage() . '</p>');
+        }
+    }
+
+    /**
+     * Cancel the experiment with the given ID
+     * @param $expId
+     */
+    public static function cancel_experiment($expId)
+    {
+
+        try {
+            Airavata::terminateExperiment($expId, Config::get('pga_config.airavata')["credential-store-token"]);
+
+            CommonUtilities::print_success_message("Experiment canceled!");
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem canceling the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (ExperimentNotFoundException $enf) {
+            CommonUtilities::print_error_message('<p>There was a problem canceling the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem canceling the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem canceling the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('<p>There was a problem canceling the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>TTransportException: ' . $tte->getMessage() . '</p>');
+        } catch (Exception $e) {
+            CommonUtilities::print_error_message('<p>There was a problem canceling the experiment.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Exception: ' . $e->getMessage() . '</p>');
+        }
+    }
+
+    /**
+     * Create form inputs to accept the inputs to the given application
+     * @param $id
+     * @param $isRequired
+     * @internal param $required
+     */
+    public static function create_inputs($id, $isRequired)
+    {
+        $inputs = AppUtilities::get_application_inputs($id);
+
+        $required = $isRequired ? ' required' : '';
+
+        //var_dump( $inputs);  echo "<br/>after sort<br/>";
+        //arranging inputs in ascending order.
+        foreach ($inputs as $index => $input) {
+            $order[$index] = $input->inputOrder;
+        }
+        array_multisort($order, SORT_ASC, $inputs);
+        //var_dump( $inputs); exit;
+        foreach ($inputs as $input) {
+            switch ($input->type) {
+                case DataType::STRING:
+                    echo '<div class="form-group">
+                    <label for="experiment-input">' . $input->name . '</label>
+                    <input value="' . $input->value . '" type="text" class="form-control" name="' . $input->name .
+                        '" id="' . $input->name .
+                        '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '>
+                    </div>';
+                    break;
+                case DataType::INTEGER:
+                    echo '<div class="form-group">
+                    <label for="experiment-input">' . $input->name . '</label>
+                    <input value="' . $input->value . '" type="number" class="form-control" name="' . $input->name .
+                        '" id="' . $input->name .
+                        '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '>
+                    </div>';
+                    break;
+                case DataType::FLOAT:
+                    echo '<div class="form-group">
+                    <label for="experiment-input">' . $input->name . '</label>
+                    <input value="' . $input->value . '" type="number" step="0.01" class="form-control" name="' . $input->name .
+                        '" id="' . $input->name .
+                        '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '>
+                    </div>';
+                    break;
+                case DataType::URI:
+                    echo '<div class="form-group">
+                    <label for="experiment-input">' . $input->name . '</label>
+                    <input class="file-input" type="file" name="' . $input->name .
+                        '" id="' . $input->name . '" ' . $required . '>
+                    <p class="help-block">' . $input->userFriendlyDescription . '</p>
+                    </div>';
+                    break;
+                default:
+                    CommonUtilities::print_error_message('Input data type not supported!
+                    Please file a bug report using the link in the Help menu.');
+                    break;
+            }
+        }
+    }
+
+
+    /**
+     * Create a new experiment from the values submitted in the form
+     * @return null
+     */
+    public static function create_experiment()
+    {
+
+        $experiment = ExperimentUtilities::assemble_experiment();
+        $expId = null;
+
+        try {
+            if ($experiment) {
+                $expId = Airavata::createExperiment(Session::get("gateway_id"), $experiment);
+            }
+
+            if ($expId) {
+                /*
+                Utilities::print_success_message("Experiment {$_POST['experiment-name']} created!" .
+                    ' <a href="experiment_summary.php?expId=' . $expId . '">Go to experiment summary page</a>');
+                */
+            } else {
+                CommonUtilities::print_error_message("Error creating experiment {$_POST['experiment-name']}!");
+            }
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
+        }
+
+        return $expId;
+    }
+
+    /*
+     * Required in Experiment Sumamry page.
+     *
+    */
+
+    public static function list_output_files($experiment, $expStatus)
+    {
+
+        $expStatusVal = array_search($expStatus, ExperimentState::$__names);
+
+        if ($expStatusVal == ExperimentState::COMPLETED) {
+            $experimentOutputs = $experiment->experimentOutputs;
+
+            foreach ((array)$experimentOutputs as $output) {
+                if ($output->type == DataType::URI || $output->type == DataType::STDOUT || $output->type == DataType::STDERR) {
+                    $explode = explode('/', $output->value);
+                    //echo '<p>' . $output->key .  ': <a href="' . $output->value . '">' . $output->value . '</a></p>';
+                    $outputPath = str_replace(ExperimentUtilities::$experimentDataPathAbsolute, Config::get('pga_config.airavata')['experiment-data-root'], $output->value);
+                    $outputPathArray = explode("/", $outputPath);
+
+                    echo '<p>' . $output->name . ' : ' . '<a target="_blank"
+                            href="' . URL::to("/") . "/.." . str_replace(ExperimentUtilities::$experimentDataPathAbsolute, Config::get('pga_config.airavata')['experiment-data-root'], $output->value) . '">' .
+                        $outputPathArray[sizeof($outputPathArray) - 1] . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
+                } elseif ($output->type == DataType::STRING) {
+                    echo '<p>' . $output->value . '</p>';
+                }
+            }
+        } else
+            echo "Experiment hasn't completed. Experiment Status is : " . $expStatus;
+    }
+
+    public static function get_experiment_values($experiment, $project, $forSearch = false)
+    {
+        //var_dump( $experiment); exit;
+        $expVal = array();
+        $expVal["experimentStatusString"] = "";
+        $expVal["experimentTimeOfStateChange"] = "";
+        $expVal["experimentCreationTime"] = "";
+
+        if ($experiment->experimentStatus != null) {
+            $experimentStatus = $experiment->experimentStatus;
+            $experimentState = $experimentStatus->experimentState;
+            $experimentStatusString = ExperimentState::$__names[$experimentState];
+            $expVal["experimentStatusString"] = $experimentStatusString;
+            $expVal["experimentTimeOfStateChange"] = $experimentStatus->timeOfStateChange / 1000; // divide by 1000 since timeOfStateChange is in ms
+            $expVal["experimentCreationTime"] = $experiment->creationTime / 1000; // divide by 1000 since creationTime is in ms
+        }
+        $jobStatus = Airavata::getJobStatuses($experiment->experimentID);
+
+        if ($jobStatus) {
+            $jobName = array_keys($jobStatus);
+            $jobState = JobState::$__names[$jobStatus[$jobName[0]]->jobState];
+        } else {
+            $jobState = null;
+        }
+
+        $expVal["jobState"] = $jobState;
+
+        if (!$forSearch) {
+            $userConfigData = $experiment->userConfigurationData;
+            $scheduling = $userConfigData->computationalResourceScheduling;
+            $expVal['scheduling'] = $scheduling;
+            $expVal["computeResource"] = CRUtilities::get_compute_resource($scheduling->resourceHostId);
+        }
+        $expVal["applicationInterface"] = AppUtilities::get_application_interface($experiment->applicationId);
+
+
+        switch ($experimentStatusString) {
+            case 'CREATED':
+            case 'VALIDATED':
+            case 'SCHEDULED':
+            case 'CANCELED':
+            case 'FAILED':
+                $expVal["editable"] = true;
+                break;
+            default:
+                $expVal["editable"] = false;
+                break;
+        }
+
+        switch ($experimentStatusString) {
+            case 'CREATED':
+            case 'VALIDATED':
+            case 'SCHEDULED':
+            case 'LAUNCHED':
+            case 'EXECUTING':
+                $expVal["cancelable"] = true;
+                break;
+            default:
+                $expVal["cancelable"] = false;
+                break;
+        }
+
+        return $expVal;
+
+    }
+
+
+    /**
+     * Create options for the search key select input
+     * @param $values
+     * @param $labels
+     * @param $disabled
+     */
+    public static function create_options($values, $labels, $disabled)
+    {
+        for ($i = 0; $i < sizeof($values); $i++) {
+            $selected = '';
+
+            // if option was previously selected, mark it as selected
+            if (isset($_POST['search-key'])) {
+                if ($values[$i] == $_POST['search-key']) {
+                    $selected = 'selected';
+                }
+            }
+
+            echo '<option value="' . $values[$i] . '" ' . $disabled[$i] . ' ' . $selected . '>' . $labels[$i] . '</option>';
+        }
+    }
+
+    /**
+     * Get results of the user's search of experiments with pagination
+     * @return array|null
+     */
+    public static function get_expsearch_results_with_pagination($inputs, $limit, $offset)
+    {
+        $experiments = array();
+
+        try {
+            $filters = array();
+            if ($inputs["status-type"] != "ALL") {
+                $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::STATUS] = $inputs["status-type"];
+            }
+            switch ($inputs["search-key"]) {
+                case 'experiment-name':
+                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_NAME] = $inputs["search-value"];
+                    break;
+                case 'experiment-description':
+                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_DESC] = $inputs["search-value"];
+                    break;
+                case 'application':
+                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::APPLICATION_ID] = $inputs["search-value"];
+                    break;
+                case 'creation-time':
+                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::FROM_DATE] = strtotime($inputs["from-date"]) * 1000;
+                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::TO_DATE] = strtotime($inputs["to-date"]) * 1000;
+                    break;
+                case '':
+            }
+            $experiments = Airavata::searchExperiments(
+                Session::get('gateway_id'), Session::get('username'), $filters, $limit, $offset);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
+                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
+                                <a href="create_project.php">here</a> to create a new project.</p>');
+            } else {
+                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
+                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
+            }
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        //get values of all experiments
+        $expContainer = array();
+        $expNum = 0;
+        foreach ($experiments as $experiment) {
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectID), true);
+            $expContainer[$expNum]['experiment'] = $experiment;
+            if ($expValue["experimentStatusString"] == "FAILED")
+                $expValue["editable"] = false;
+            $expContainer[$expNum]['expValue'] = $expValue;
+            $expNum++;
+        }
+
+        return $expContainer;
+    }
+
+    /**
+     * Get results of the user's search of experiments
+     * @return array|null
+     */
+    public static function get_expsearch_results($inputs)
+    {
+        $experiments = array();
+
+        try {
+            switch ($inputs["search-key"]) {
+                case 'experiment-name':
+                    $experiments = Airavata::searchExperimentsByName(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
+                    break;
+                case 'experiment-description':
+                    $experiments = Airavata::searchExperimentsByDesc(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
+                    break;
+                case 'application':
+                    $experiments = Airavata::searchExperimentsByApplication(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
+                    break;
+                case 'creation-time':
+                    $experiments = Airavata::searchExperimentsByCreationTime(Session::get('gateway_id'), Session::get('username'), strtotime($inputs["from-date"]) * 1000, strtotime($inputs["to-date"]) * 1000);
+                    break;
+                case '':
+            }
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
+                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
+                                <a href="create_project.php">here</a> to create a new project.</p>');
+            } else {
+                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
+                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
+            }
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        //get values of all experiments
+        $expContainer = array();
+        $expNum = 0;
+        foreach ($experiments as $experiment) {
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectID), true);
+            $expContainer[$expNum]['experiment'] = $experiment;
+            if ($expValue["experimentStatusString"] == "FAILED")
+                $expValue["editable"] = false;
+            $expContainer[$expNum]['expValue'] = $expValue;
+            $expNum++;
+        }
+
+        return $expContainer;
+    }
+
+    /**
+     * Get results of the user's all experiments with pagination.
+     * Results are ordered creation time DESC
+     * @return array|null
+     */
+    public static function get_all_user_experiments_with_pagination($limit, $offset)
+    {
+        $experiments = array();
+
+        try {
+            $experiments = Airavata::getAllUserExperimentsWithPagination(
+                Session::get('gateway_id'), Session::get('username'), $limit, $offset
+            );
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
+                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
+                                <a href="create_project.php">here</a> to create a new project.</p>');
+            } else {
+                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
+                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
+            }
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        //get values of all experiments
+        $expContainer = array();
+        $expNum = 0;
+        foreach ($experiments as $experiment) {
+            $expValue = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectID), true);
+            $expContainer[$expNum]['experiment'] = $experiment;
+            if ($expValue["experimentStatusString"] == "FAILED")
+                $expValue["editable"] = false;
+            $expContainer[$expNum]['expValue'] = $expValue;
+            $expNum++;
+        }
+
+        return $expContainer;
+    }
+
+    public static function getExpStates()
+    {
+        return ExperimentState::$__names;
+    }
+
+
+    public static function apply_changes_to_experiment($experiment, $input)
+    {
+        $experiment->name = $input['experiment-name'];
+        $experiment->description = rtrim($input['experiment-description']);
+        $experiment->projectID = $input['project'];
+        //$experiment->applicationId = $_POST['application'];
+
+        $userConfigDataUpdated = $experiment->userConfigurationData;
+        $schedulingUpdated = $userConfigDataUpdated->computationalResourceScheduling;
+
+        $schedulingUpdated->resourceHostId = $input['compute-resource'];
+        $schedulingUpdated->nodeCount = $input['node-count'];
+        $schedulingUpdated->queueName = $_POST['queue-name'];
+        $schedulingUpdated->totalCPUCount = $input['cpu-count'];
+        //$schedulingUpdated->numberOfThreads = $input['threads'];
+        $schedulingUpdated->wallTimeLimit = $input['wall-time'];
+        //$schedulingUpdated->totalPhysicalMemory = $input['memory'];
+
+        /*
+        switch ($_POST['compute-resource'])
+        {
+            case 'trestles.sdsc.edu':
+                $schedulingUpdated->ComputationalProjectAccount = 'sds128';
+                break;
+            case 'stampede.tacc.xsede.org':
+            case 'lonestar.tacc.utexas.edu':
+                $schedulingUpdated->ComputationalProjectAccount = 'TG-STA110014S';
+                break;
+            default:
+                $schedulingUpdated->ComputationalProjectAccount = 'admin';
+        }
+        */
+
+        $userConfigDataUpdated->computationalResourceScheduling = $schedulingUpdated;
+        if (isset($input["userDN"])) {
+            $userConfigDataUpdated->generateCert = 1;
+            $userConfigDataUpdated->userDN = $input["userDN"];
+        }
+
+        $experiment->userConfigurationData = $userConfigDataUpdated;
+
+        $applicationInputs = AppUtilities::get_application_inputs($experiment->applicationId);
+
+        $experimentInputs = $experiment->experimentInputs; // get current inputs
+        //var_dump($experimentInputs);
+        $experimentInputs = ExperimentUtilities::process_inputs($applicationInputs, $experimentInputs); // get new inputs
+        //var_dump($experimentInputs);
+
+        if ($experimentInputs) {
+            $experiment->experimentInputs = $experimentInputs;
+            //var_dump($experiment);
+            return $experiment;
+        }
+    }
+
+    public static function get_job_details($experimentId)
+    {
+        return Airavata::getJobDetails($experimentId);
+    }
+
+    public static function get_transfer_details($experimentId)
+    {
+        return Airavata::getDataTransferDetails($experimentId);
+    }
+
+    public static function getQueueDatafromResourceId($crId)
+    {
+        $resourceObject = Airavata::getComputeResource($crId);
+        return $resourceObject->batchQueues;
+    }
+
+    /**
+     * Create a select input and populate it with applications options
+     * @param null $id
+     * @param bool $editable
+     */
+    public static function create_application_select($id = null, $editable = true)
+    {
+        $disabled = $editable ? '' : 'disabled';
+
+        $applicationIds = AppUtilities::get_all_applications();
+
+        echo '<select class="form-control" name="application" id="application" required ' . $disabled . '>';
+
+        if (count($applicationIds)) {
+            foreach ((array)$applicationIds as $applicationId => $applicationName) {
+                $selected = ($applicationId == $id) ? 'selected' : '';
+
+                echo '<option value="' . $applicationId . '" ' . $selected . '>' . $applicationName . '</option>';
+            }
+        }
+
+        echo '</select>';
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/ProjectUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/ProjectUtilities.php b/app/libraries/ProjectUtilities.php
new file mode 100644
index 0000000..7f00a8f
--- /dev/null
+++ b/app/libraries/ProjectUtilities.php
@@ -0,0 +1,282 @@
+<?php
+
+use Airavata\API\Error\AiravataClientException;
+use Airavata\API\Error\AiravataSystemException;
+use Airavata\API\Error\InvalidRequestException;
+use Airavata\Facades\Airavata;
+use Airavata\Model\Workspace\Project;
+
+class ProjectUtilities
+{
+
+    /**
+     * Get all projects owned by the given user
+     * @param $username
+     * @return null
+     */
+    public static function get_all_user_projects($gatewayId, $username)
+    {
+        $userProjects = null;
+
+        try {
+            $userProjects = Airavata::getAllUserProjects($gatewayId, $username);
+            //var_dump( $userProjects); exit;
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the user\'s projects.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the user\'s projects.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_warning_message('<p>You must create a project before you can create an experiment.
+                Click <a href="' . URL::to('/') . '/project/create">here</a> to create a project.</p>');
+            } else {
+                CommonUtilities::print_error_message('<p>There was a problem getting the user\'s projects.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                    '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
+            }
+        }
+
+        return $userProjects;
+    }
+
+    /**
+     * Get the project with the given ID
+     * @param $projectId
+     * @return null
+     */
+    public static function get_project($projectId)
+    {
+
+        try {
+            return Airavata::getProject($projectId);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the project.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the project.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the project.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');
+        }
+
+    }
+
+    /**
+     * Create a select input and populate it with project options from the database
+     */
+    public static function create_project_select($projectId = null, $editable = true)
+    {
+        $editable ? $disabled = '' : $disabled = 'disabled';
+        $userProjects = ProjectUtilities::get_all_user_projects(Session::get("gateway_id"), Session::get('username'));
+
+        echo '<select class="form-control" name="project" id="project" required ' . $disabled . '>';
+        if (sizeof($userProjects) > 0) {
+            foreach ($userProjects as $project) {
+                if ($project->projectID == $projectId) {
+                    $selected = 'selected';
+                } else {
+                    $selected = '';
+                }
+
+                echo '<option value="' . $project->projectID . '" ' . $selected . '>' . $project->name . '</option>';
+            }
+        }
+        echo '</select>';
+        if (sizeof($userProjects) == 0) {
+            CommonUtilities::print_warning_message('<p>You must create a project before you can create an experiment.
+                Click <a href="' . URL::to('/') . '/project/create">here</a> to create a project.</p>');
+        }
+    }
+
+    //moved from create project view.
+
+    public static function create_project()
+    {
+        $project = new Project();
+        $project->owner = Session::get('username');
+        $project->name = $_POST['project-name'];
+        $project->description = $_POST['project-description'];
+
+
+        $projectId = null;
+
+        try {
+            $projectId = Airavata::createProject(Config::get('pga_config.airavata')['gateway-id'], $project);
+
+            if ($projectId) {
+                CommonUtilities::print_success_message("<p>Project {$_POST['project-name']} created!</p>" .
+                    '<p>You will be redirected to the summary page shortly, or you can
+                    <a href="project/summary?projId=' . $projectId . '">go directly</a> to the project summary page.</p>');
+            } else {
+                CommonUtilities::print_error_message("Error creating project {$_POST['project-name']}!");
+            }
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
+        }
+
+        return $projectId;
+    }
+
+    /**
+     * Get experiments in project
+     * @param $projectId
+     * @return array|null
+     */
+    public static function get_experiments_in_project($projectId)
+    {
+
+        $experiments = array();
+
+        try {
+            $experiments = Airavata::getAllExperimentsInProject($projectId);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        return $experiments;
+    }
+
+    public static function update_project($projectId, $projectDetails)
+    {
+
+        $updatedProject = new Project();
+        $updatedProject->owner = $projectDetails["owner"];
+        $updatedProject->name = $projectDetails["name"];
+        $updatedProject->description = $projectDetails["description"];
+
+        try {
+            Airavata::updateProject($projectId, $updatedProject);
+
+            //Utilities::print_success_message('Project updated! Click <a href="project_summary.php?projId=' . $projectId . '">here</a> to view the project summary.');
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (ProjectNotFoundException $pnfe) {
+            CommonUtilities::print_error_message('ProjectNotFoundException!<br><br>' . $pnfe->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
+        }
+    }
+
+
+    public static function get_all_user_projects_with_pagination($limit, $offset)
+    {
+
+        $projects = array();
+
+        try {
+            $projects = Airavata::getAllUserProjectsWithPagination(Session::get("gateway_id"),
+                Session::get("username"), $limit, $offset);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_info_message('<p>You have not created any projects yet, so no results will be returned!</p>
+                                <p>Click <a href="create_project.php">here</a> to create a new project.</p>');
+            } else {
+                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later, or report a bug using the link in the Help menu.');
+                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
+            }
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        return $projects;
+    }
+
+
+    public static function get_projsearch_results_with_pagination($searchKey, $searchValue, $limit, $offset)
+    {
+
+        $projects = array();
+
+        try {
+            switch ($searchKey) {
+                case 'project-name':
+                    $projects = Airavata::searchProjectsByProjectNameWithPagination(Session::get("gateway_id"),
+                        Session::get("username"), $searchValue, $limit, $offset);
+                    break;
+                case 'project-description':
+                    $projects = Airavata::searchProjectsByProjectDescWithPagination(Session::get("gateway_id"),
+                        Session::get("username"), $searchValue, $limit, $offset);
+                    break;
+            }
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_info_message('<p>You have not created any projects yet, so no results will be returned!</p>
+                                <p>Click <a href="create_project.php">here</a> to create a new project.</p>');
+            } else {
+                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later, or report a bug using the link in the Help menu.');
+                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
+            }
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        return $projects;
+    }
+
+
+    public static function get_projsearch_results($searchKey, $searchValue)
+    {
+
+        $projects = array();
+
+        try {
+            switch ($searchKey) {
+                case 'project-name':
+                    $projects = Airavata::searchProjectsByProjectName(Session::get("gateway_id"), Session::get("username"), $searchValue);
+                    break;
+                case 'project-description':
+                    $projects = Airavata::searchProjectsByProjectDesc(Session::get("gateway_id"), Session::get("username"), $searchValue);
+                    break;
+            }
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
+        } catch (AiravataSystemException $ase) {
+            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
+            {
+                CommonUtilities::print_info_message('<p>You have not created any projects yet, so no results will be returned!</p>
+                                <p>Click <a href="create_project.php">here</a> to create a new project.</p>');
+            } else {
+                CommonUtilities::print_error_message('There was a problem with Airavata. Please try again later, or report a bug using the link in the Help menu.');
+                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
+            }
+        } catch (TTransportException $tte) {
+            CommonUtilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
+        }
+
+        return $projects;
+    }
+
+}
\ No newline at end of file


[04/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-users.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-users.blade.php b/app/views/admin/manage-users.blade.php
index 8ea84cd..872acaf 100644
--- a/app/views/admin/manage-users.blade.php
+++ b/app/views/admin/manage-users.blade.php
@@ -1,129 +1,134 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}
+@parent
+{{ HTML::style('css/admin.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-            @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-            <div class="col-md-12">
+<div id="wrapper">
+    <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+    @include( 'partials/dashboard-block')
+    <div id="page-wrapper">
+        <div class="col-md-12">
             @if( Session::has("message"))
-                <div class="row">
-                    <div class="alert alert-success alert-dismissible" role="alert">
-                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                        {{ Session::get("message") }}
-                    </div>
-                </div>
-                {{ Session::forget("message") }}
-            @endif
-            </div>
-            <div class="container-fluid">
-                <div class="col-md-12">
-                
-                    <h1 class="text-center">Users</h1>
-
-                    <table class="table table-striped table-condensed">
-                        <tr>
-                            <th>Username</th>
-                            <th>
-                                Role : 
-                                <select onchange="location = this.options[this.selectedIndex].value;">
-                                    <option>Select a role</option>
-                                    <option value="{{URL::to('/')}}/admin/dashboard/users">All</option>
-                                    @foreach( (array)$roles as $role)
-                                    <option value="{{URL::to('/')}}/admin/dashboard/users?role={{$role}}">{{$role}}</option>
-                                    @endforeach
-                                </select>
-                            </th>
-                        </tr>
-                        @foreach( (array)$users as $user)
-                        <tr class="user-row">
-                            <td>{{ $user }}</td>
-                            <td>
-                                <button class="button btn btn-default check-roles fade" type="button" data-username="{{$user}}">Check All Roles</button>
-                                <div class="user-roles"></div>
-                            </td>
-                        </tr>
-                        @endforeach
-                    </table>
-
+            <div class="row">
+                <div class="alert alert-success alert-dismissible" role="alert">
+                    <button type="button" class="close" data-dismiss="alert"><span
+                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+                    {{ Session::get("message") }}
                 </div>
             </div>
+            {{ Session::forget("message") }}
+            @endif
         </div>
-    </div>
+        <div class="container-fluid">
+            <div class="col-md-12">
 
-    <div class="modal fade" id="check-role-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-        <div class="modal-dialog">
-            <div class="modal-content">
-                <div class="modal-header">
-                    <h3 class="text-center">User Roles</h3>
-                </div>
-                <div class="modal-body">
-                    <h4 class="roles-of-user"></h4>
-                    <div class="roles-load">
-                        Getting User Roles. Please Wait...  <img src="{{URL::to('/')}}/assets/ajax-loader.gif"/>
-                    </div>
-                    <div class="roles-list">
-                    </div>  
-                    <div class="add-roles-block hide">
-                        <div class="form-group well">
-                            <label class="control-label">Add a new role to the user</label>
-                            <select multiple name="new-role" class="new-roles-select" class="form-control">
+                <h1 class="text-center">Users</h1>
+
+                <table class="table table-striped table-condensed">
+                    <tr>
+                        <th>Username</th>
+                        <th>
+                            Role :
+                            <select onchange="location = this.options[this.selectedIndex].value;">
                                 <option>Select a role</option>
+                                <option value="{{URL::to('/')}}/admin/dashboard/users">All</option>
                                 @foreach( (array)$roles as $role)
-                                <option value="{{$role}}">{{$role}}</option>
+                                <option value="{{URL::to('/')}}/admin/dashboard/users?role={{$role}}">{{$role}}</option>
                                 @endforeach
                             </select>
-                            <button type="button" class="btn btn-primary add-roles-submit"  data-username="">Add Roles</button>
-                        </div>
-                    </div>
+                        </th>
+                    </tr>
+                    @foreach( (array)$users as $user)
+                    <tr class="user-row">
+                        <td>{{ $user }}</td>
+                        <td>
+                            <button class="button btn btn-default check-roles fade" type="button"
+                                    data-username="{{$user}}">Check All Roles
+                            </button>
+                            <div class="user-roles"></div>
+                        </td>
+                    </tr>
+                    @endforeach
+                </table>
+
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="modal fade" id="check-role-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h3 class="text-center">User Roles</h3>
+            </div>
+            <div class="modal-body">
+                <h4 class="roles-of-user"></h4>
+
+                <div class="roles-load">
+                    Getting User Roles. Please Wait... <img src="{{URL::to('/')}}/assets/ajax-loader.gif"/>
+                </div>
+                <div class="roles-list">
                 </div>
-                <div class="modal-footer">
-                    <div class="form-group">
-                        <input type="submit" class="btn" data-dismiss="modal"  value="Close"/>
+                <div class="add-roles-block hide">
+                    <div class="form-group well">
+                        <label class="control-label">Add a new role to the user</label>
+                        <select multiple name="new-role" class="new-roles-select" class="form-control">
+                            <option>Select a role</option>
+                            @foreach( (array)$roles as $role)
+                            <option value="{{$role}}">{{$role}}</option>
+                            @endforeach
+                        </select>
+                        <button type="button" class="btn btn-primary add-roles-submit" data-username="">Add Roles
+                        </button>
                     </div>
                 </div>
             </div>
-            <input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
+            <div class="modal-footer">
+                <div class="form-group">
+                    <input type="submit" class="btn" data-dismiss="modal" value="Close"/>
+                </div>
+            </div>
         </div>
+        <input type="hidden" class="base-url" value="{{URL::to('/')}}"/>
     </div>
+</div>
 
-    <div class="role-block hide">
-        <div class="btn-group" role="group">
-            <button type="button" class="btn btn-default role-name" disabled>Role</button>
-            <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span></button>
-        </div>
+<div class="role-block hide">
+    <div class="btn-group" role="group">
+        <button type="button" class="btn btn-default role-name" disabled>Role</button>
+        <button type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span></button>
     </div>
+</div>
 @stop
 
 @section('scripts')
-    @parent
-    <script>
+@parent
+<script>
 
-    $(".user-row").hover( 
-        function(){
+    $(".user-row").hover(
+        function () {
             $(this).find(".check-roles").addClass("in");
         },
-        function(){
+        function () {
             $(this).find(".check-roles").removeClass("in");
         }
     );
-    $(".check-roles").click( function(){
+    $(".check-roles").click(function () {
 
         //remove disabled roles from previous actions.
-        $(".new-roles-select option").each(function()
-        {
+        $(".new-roles-select option").each(function () {
             $(this).removeAttr("disabled");
         });
 
         var userName = $(this).data("username");
         $("#check-role-block").modal("show");
-        $(".roles-of-user").html( "User : " + userName);
+        $(".roles-of-user").html("User : " + userName);
         $(".roles-load").removeClass("hide");
         $(".roles-list").addClass("hide");
         $(".add-roles-submit").data("username", userName);
@@ -134,62 +139,60 @@
         $.ajax({
             type: "POST",
             url: $(".base-url").val() + "/admin/check-roles",
-            data: 
-            { 
-              username: userName
+            data: {
+                username: userName
             }
         })
-        .complete(function( data ) {
-            roles = JSON.parse( data.responseText );
-            roleBlocks = "";
-            for( var i=0; i<roles.length; i++)
-            {
-                //disable roles which user already has.
-                $(".new-roles-select option").each(function()
-                {
-                    if( $(this).val() == roles[i])
-                        $(this).attr("disabled", "disabled");
-                    else
-                        $(this).removeAttr("disabled");
-                });
-                $(".role-block").find(".role-name").html( roles[i]);
-                var newRoleBlock = $(".role-block").html();
-                roleBlocks += newRoleBlock;
-                $(".roles-list").html( roleBlocks);
-
-                $(".add-roles-block").removeClass("hide");
-            }
-            $(".roles-load").addClass("hide");
-            $(".roles-list").removeClass("hide");
+            .complete(function (data) {
+                roles = JSON.parse(data.responseText);
+                roleBlocks = "";
+                for (var i = 0; i < roles.length; i++) {
+                    //disable roles which user already has.
+                    $(".new-roles-select option").each(function () {
+                        if ($(this).val() == roles[i])
+                            $(this).attr("disabled", "disabled");
+                        else
+                            $(this).removeAttr("disabled");
+                    });
+                    $(".role-block").find(".role-name").html(roles[i]);
+                    var newRoleBlock = $(".role-block").html();
+                    roleBlocks += newRoleBlock;
+                    $(".roles-list").html(roleBlocks);
+
+                    $(".add-roles-block").removeClass("hide");
+                }
+                $(".roles-load").addClass("hide");
+                $(".roles-list").removeClass("hide");
 
 
-        });
+            });
 
-        $(".add-roles-submit").click( function(){
+        $(".add-roles-submit").click(function () {
             $(this).attr("disabled", "disabled");
             $(this).html("<img src='" + $(".base-url").val() + "/ajax-loader.gif'/>");
             userName = $(this).data("username");
             var rolesToAdd = $(".new-roles-select").val();
-            $(".roles-list").find(".role-name").each( function(){
-                rolesToAdd.push( $(this).html() );
+            $(".roles-list").find(".role-name").each(function () {
+                rolesToAdd.push($(this).html());
             })
             $.ajax({
                 type: "POST",
                 url: $(".base-url").val() + "/admin/add-roles-to-user",
-                data: 
-                { 
+                data: {
                     add: true,
                     username: userName,
-                    roles : rolesToAdd
+                    roles: rolesToAdd
                 },
-                success( data){
-                    console.log( data);
-                }
-            });
-            $(".add-roles-submit").html( "Add Roles");
-            $(".add-roles-submit").after("<span class='alert alert-success col-md-12'>Roles have been added</span>");
+                success( data)
+            {
+                console.log(data);
+            }
         });
-
+        $(".add-roles-submit").html("Add Roles");
+        $(".add-roles-submit").after("<span class='alert alert-success col-md-12'>Roles have been added</span>");
     });
-    </script>
+
+    })
+    ;
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/application/deployment.blade.php
----------------------------------------------------------------------
diff --git a/app/views/application/deployment.blade.php b/app/views/application/deployment.blade.php
index 2cad93b..d33ff9f 100644
--- a/app/views/application/deployment.blade.php
+++ b/app/views/application/deployment.blade.php
@@ -1,180 +1,193 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/style.css') }}
+@parent
+{{ HTML::style('css/style.css') }}
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-		
-		<div class="row">
-			<button class="btn btn-default create-app-deployment">Create a new Application Deployment</button>
-		</div>
-		@if( count( $appDeployments) )
-			@if( Session::has("message"))
-				<div class="row">
-					<div class="alert alert-success alert-dismissible" role="alert">
-						<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-						{{ Session::get("message") }}
-					</div>
-				</div>
-				{{ Session::forget("message") }}
-			@endif
-
-			<div class="row">
-				<div class="col-md-6">
-					<h3>Existing Application Deployments :</h3>
-				</div>
-				<div class="col-md-6" style="margin-top:3.5%">
-					<input type="text" class="col-md-12 filterinput" placeholder="Search by Deployment Id Name" />
-				</div>
-			</div>
-			<div class="panel-group" id="accordion">
-			@foreach( $appDeployments as $index => $deployment )
-				<div class="panel panel-default">
-					<div class="panel-heading">
-						<h4 class="panel-title">
-							<a class="accordion-toggle collapsed deployment-id" data-toggle="collapse" data-parent="#accordion" href="#collapse-{{$index}}">
-							{{ $deployment->appDeploymentId }}
-							</a>
-							<div class="pull-right col-md-2 deployment-options fade">
-								<span class="glyphicon glyphicon-pencil edit-app-deployment" style="cursor:pointer;" data-toggle="modal" data-target="#edit-app-deployment-block" data-deployment-id="{{ $deployment->appDeploymentId }}"></span>
-								<span class="glyphicon glyphicon-trash delete-app-deployment" style="cursor:pointer;" data-toggle="modal" data-target="#delete-app-deployment-block" data-deployment-id="{{ $deployment->appDeploymentId }}"></span>
-							</div>
-						</h4>
-					</div>
-					<div id="collapse-{{$index}}" class="panel-collapse collapse">
-						<div class="panel-body">
-							<div class="app-deployment-block">
-								@include('partials/deployment-block', array( 'deploymentObject' => $deployment, 'computeResources' => $computeResources, 'modules' => $modules) )
-							</div>
-						</div>
-					</div>
-				</div>
-			@endforeach
-			</div>
-		@endif
-
-		<div class="load-cmd-ui hide">
-			<input name="moduleLoadCmds[]" type="text" class="form-control" placeholder="Module Load Command"/>
-		</div>
-
-		<div class="lib-prepend-path-ui hide">
-			<div class="col-md-12 well">
-				<input name="libraryPrependPathName[]" type="text" class="col-md-4" placeholder="Name"/>
-				<input name="libraryPrependPathValue[]" type="text" class="col-md-8" placeholder="Value"/>
-			</div>
-		</div>
-
-		<div class="lib-append-path-ui hide">
-			<div class="col-md-12 well">
-				<input name="libraryAppendPathName[]" type="text" class="col-md-4" placeholder="Name"/>
-				<input name="libraryAppendPathValue[]" type="text" class="col-md-8" placeholder="Value"/>
-			</div>
-		</div>
-
-		<div class="environment-ui hide">
-			<div class="col-md-12 well">
-				<input name="environmentName[]" type="text" class="col-md-4" placeholder="Name"/>
-				<input name="environmentValue[]" type="text" class="col-md-8" placeholder="Value"/>
-			</div>
-		</div>
-
-		<div class="pre-job-command-ui hide">
-			<div class="col-md-12 well">
-				<input name="preJobCommand[]" type="text" class="col-md-12" placeholder="Pre Job Command"/>
-			</div>
-		</div>
-
-		<div class="post-job-command-ui hide">
-			<div class="col-md-12 well">
-				<input name="postJobCommand[]" type="text" class="col-md-12" placeholder="Post Job Command"/>
-			</div>
-		</div>
-
-		<div class="modal fade" id="edit-app-deployment-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-		    <div class="modal-dialog">
-				<form action="{{URL::to('/')}}/app/deployment-edit" method="POST">	
-		        <div class="modal-content">
-			    	<div class="modal-header">
-			    		<h3 class="text-center">Edit Application Deployment</h3>
-			    	</div>
-			    	<div class="modal-body row">
-						<div class="app-deployment-form-content col-md-12">
-						</div>
-					</div>
-					<div class="modal-footer">
-			        	<div class="form-group">
-							<input type="submit" class="btn btn-primary" value="Update"/>
-							<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-						</div>
-			        </div>	
-		        </div>
-		        </form>
-		    </div>
-		</div>
-
-		<div class="modal fade" id="create-app-deployment-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-		    <div class="modal-dialog">
-				<form action="{{URL::to('/')}}/app/deployment-create" method="POST">	
-		        <div class="modal-content">
-			    	<div class="modal-header">
-			    		<h3 class="text-center">Create Application Deployment</h3>
-			    	</div>
-			    	<div class="modal-body row">
-						<div class="col-md-12">
-							<div class="create-app-deployment-block">
-								@include('partials/deployment-block', array( 'computeResources' => $computeResources, 'modules' => $modules) )
-							</div>
-						</div>
-					</div>
-					<div class="modal-footer">
-			        	<div class="form-group">
-							<input type="submit" class="btn btn-primary" value="Create"/>
-							<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-						</div>
-			        </div>	
-		        </div>
-		        </form>
-		    </div>
-		</div>
-
-		<div class="modal fade" id="delete-app-deployment-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-		    <div class="modal-dialog">
-
-				<form action="{{URL::to('/')}}/app/deployment-delete" method="POST">
-			        <div class="modal-content">
-			            <div class="modal-header">
-			              	<h3 class="text-center">Delete Confirmation Application Deployment</h3>
-			            </div>
-			            <div class="modal-body">
-							<input type="hidden" class="form-control delete-deploymentId" name="appDeploymentId"/>
-					 		Do you really want to delete the Application Deployment - <span class="delete-deployment-id"></span>
-						</div>
-						<div class="modal-footer">
-							<div class="form-group">
-								<input type="submit" class="btn btn-danger" value="Delete"/>
-								<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-							</div>
-						</div>
-					</div>
-
-				</form>
-
-
-			</div>
-		</div>
-
-	</div>
+    <div class="col-md-offset-2 col-md-8">
+
+        <div class="row">
+            <button class="btn btn-default create-app-deployment">Create a new Application Deployment</button>
+        </div>
+        @if( count( $appDeployments) )
+        @if( Session::has("message"))
+        <div class="row">
+            <div class="alert alert-success alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                        class="sr-only">Close</span></button>
+                {{ Session::get("message") }}
+            </div>
+        </div>
+        {{ Session::forget("message") }}
+        @endif
+
+        <div class="row">
+            <div class="col-md-6">
+                <h3>Existing Application Deployments :</h3>
+            </div>
+            <div class="col-md-6" style="margin-top:3.5%">
+                <input type="text" class="col-md-12 filterinput" placeholder="Search by Deployment Id Name"/>
+            </div>
+        </div>
+        <div class="panel-group" id="accordion">
+            @foreach( $appDeployments as $index => $deployment )
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a class="accordion-toggle collapsed deployment-id" data-toggle="collapse"
+                           data-parent="#accordion" href="#collapse-{{$index}}">
+                            {{ $deployment->appDeploymentId }}
+                        </a>
+
+                        <div class="pull-right col-md-2 deployment-options fade">
+                            <span class="glyphicon glyphicon-pencil edit-app-deployment" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#edit-app-deployment-block"
+                                  data-deployment-id="{{ $deployment->appDeploymentId }}"></span>
+                            <span class="glyphicon glyphicon-trash delete-app-deployment" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#delete-app-deployment-block"
+                                  data-deployment-id="{{ $deployment->appDeploymentId }}"></span>
+                        </div>
+                    </h4>
+                </div>
+                <div id="collapse-{{$index}}" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        <div class="app-deployment-block">
+                            @include('partials/deployment-block', array( 'deploymentObject' => $deployment,
+                            'computeResources' => $computeResources, 'modules' => $modules) )
+                        </div>
+                    </div>
+                </div>
+            </div>
+            @endforeach
+        </div>
+        @endif
+
+        <div class="load-cmd-ui hide">
+            <input name="moduleLoadCmds[]" type="text" class="form-control" placeholder="Module Load Command"/>
+        </div>
+
+        <div class="lib-prepend-path-ui hide">
+            <div class="col-md-12 well">
+                <input name="libraryPrependPathName[]" type="text" class="col-md-4" placeholder="Name"/>
+                <input name="libraryPrependPathValue[]" type="text" class="col-md-8" placeholder="Value"/>
+            </div>
+        </div>
+
+        <div class="lib-append-path-ui hide">
+            <div class="col-md-12 well">
+                <input name="libraryAppendPathName[]" type="text" class="col-md-4" placeholder="Name"/>
+                <input name="libraryAppendPathValue[]" type="text" class="col-md-8" placeholder="Value"/>
+            </div>
+        </div>
+
+        <div class="environment-ui hide">
+            <div class="col-md-12 well">
+                <input name="environmentName[]" type="text" class="col-md-4" placeholder="Name"/>
+                <input name="environmentValue[]" type="text" class="col-md-8" placeholder="Value"/>
+            </div>
+        </div>
+
+        <div class="pre-job-command-ui hide">
+            <div class="col-md-12 well">
+                <input name="preJobCommand[]" type="text" class="col-md-12" placeholder="Pre Job Command"/>
+            </div>
+        </div>
+
+        <div class="post-job-command-ui hide">
+            <div class="col-md-12 well">
+                <input name="postJobCommand[]" type="text" class="col-md-12" placeholder="Post Job Command"/>
+            </div>
+        </div>
+
+        <div class="modal fade" id="edit-app-deployment-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+                <form action="{{URL::to('/')}}/app/deployment-edit" method="POST">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Edit Application Deployment</h3>
+                        </div>
+                        <div class="modal-body row">
+                            <div class="app-deployment-form-content col-md-12">
+                            </div>
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-primary" value="Update"/>
+                                <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+
+        <div class="modal fade" id="create-app-deployment-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+                <form action="{{URL::to('/')}}/app/deployment-create" method="POST">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Create Application Deployment</h3>
+                        </div>
+                        <div class="modal-body row">
+                            <div class="col-md-12">
+                                <div class="create-app-deployment-block">
+                                    @include('partials/deployment-block', array( 'computeResources' =>
+                                    $computeResources, 'modules' => $modules) )
+                                </div>
+                            </div>
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-primary" value="Create"/>
+                                <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+
+        <div class="modal fade" id="delete-app-deployment-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+
+                <form action="{{URL::to('/')}}/app/deployment-delete" method="POST">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Delete Confirmation Application Deployment</h3>
+                        </div>
+                        <div class="modal-body">
+                            <input type="hidden" class="form-control delete-deploymentId" name="appDeploymentId"/>
+                            Do you really want to delete the Application Deployment - <span
+                                class="delete-deployment-id"></span>
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-danger" value="Delete"/>
+                                <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                            </div>
+                        </div>
+                    </div>
+
+                </form>
+
+
+            </div>
+        </div>
+
+    </div>
 
 </div>
 
 @stop
 
 @section('scripts')
-	@parent
-    {{ HTML::script('js/deployment.js') }}
+@parent
+{{ HTML::script('js/deployment.js') }}
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/application/interface.blade.php
----------------------------------------------------------------------
diff --git a/app/views/application/interface.blade.php b/app/views/application/interface.blade.php
index 140a951..1a2d0c2 100644
--- a/app/views/application/interface.blade.php
+++ b/app/views/application/interface.blade.php
@@ -1,165 +1,181 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/style.css') }}
+@parent
+{{ HTML::style('css/style.css') }}
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-		
-		<div class="row">
-			<button class="btn btn-default create-app-interface">Create a new Application Interface</button>
-		</div>
-		@if( count( $appInterfaces) )
-			@if( Session::has("message"))
-				<div class="row">
-					<div class="alert alert-success alert-dismissible" role="alert">
-						<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-						{{ Session::get("message") }}
-					</div>
-				</div>
-				{{ Session::forget("message") }}
-			@endif
-			<div class="row">
-
-				<div class="col-md-6">
-					<h3>Existing Application Interfaces :</h3>
-				</div>
-				<div class="col-md-6" style="margin-top:3.5%">
-					<input type="text" class="col-md-12 filterinput" placeholder="Search by Interface Name" />
-				</div>
-			</div>
-			<div class="panel-group" id="accordion">
-			@foreach( $appInterfaces as $index => $interface )
-				<div class="panel panel-default">
-					<div class="panel-heading">
-						<h4 class="panel-title">
-							<a class="accordion-toggle collapsed interface-name" data-toggle="collapse" data-parent="#accordion" href="#collapse-{{$index}}">
-							{{ $interface->applicationName }}
-							</a>
-							<div class="pull-right col-md-2 interface-options fade">
-								<span class="glyphicon glyphicon-pencil edit-app-interface" style="cursor:pointer;" data-toggle="modal" data-target="#edit-app-interface-block" data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
-								<span class="glyphicon glyphicon-trash delete-app-interface" style="cursor:pointer;" data-toggle="modal" data-target="#delete-app-interface-block" data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
-							</div>
-						</h4>
-					</div>
-					<div id="collapse-{{$index}}" class="panel-collapse collapse">
-						<div class="panel-body">
-							<div class="app-interface-block">
-								@include('partials/interface-block', array( 'interfaceObject' => $interface, 'dataTypes' => $dataTypes, 'modules' => $modules) )
-							</div>
-						</div>
-					</div>
-				</div>
-			@endforeach
-			</div>
-		@endif
-
-	</div>
-
-	<div class="app-module-block hide">
-		<div class="input-group">
-			<select name="applicationModules[]" class="app-module-select form-control">
-				@foreach( $modules as $index=> $module)
-				<option value="{{ $module->appModuleId}}">{{ $module->appModuleName }}</option>
-				@endforeach
-			</select>
-			<span class="input-group-addon remove-app-module" style="cursor:pointer;">x</span>
-		</div>
-	</div>
-
-	<div class="app-input-block hide">
-		@include('partials/interface-input-block', array( 'dataTypes' => $dataTypes) )
-	</div>
-
-	<div class="app-output-block hide">
-		@include('partials/interface-output-block', array( 'dataTypes' => $dataTypes) )
-	</div>
+    <div class="col-md-offset-2 col-md-8">
+
+        <div class="row">
+            <button class="btn btn-default create-app-interface">Create a new Application Interface</button>
+        </div>
+        @if( count( $appInterfaces) )
+        @if( Session::has("message"))
+        <div class="row">
+            <div class="alert alert-success alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                        class="sr-only">Close</span></button>
+                {{ Session::get("message") }}
+            </div>
+        </div>
+        {{ Session::forget("message") }}
+        @endif
+        <div class="row">
+
+            <div class="col-md-6">
+                <h3>Existing Application Interfaces :</h3>
+            </div>
+            <div class="col-md-6" style="margin-top:3.5%">
+                <input type="text" class="col-md-12 filterinput" placeholder="Search by Interface Name"/>
+            </div>
+        </div>
+        <div class="panel-group" id="accordion">
+            @foreach( $appInterfaces as $index => $interface )
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a class="accordion-toggle collapsed interface-name" data-toggle="collapse"
+                           data-parent="#accordion" href="#collapse-{{$index}}">
+                            {{ $interface->applicationName }}
+                        </a>
+
+                        <div class="pull-right col-md-2 interface-options fade">
+                            <span class="glyphicon glyphicon-pencil edit-app-interface" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#edit-app-interface-block"
+                                  data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
+                            <span class="glyphicon glyphicon-trash delete-app-interface" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#delete-app-interface-block"
+                                  data-interface-id="{{ $interface->applicationInterfaceId }}"></span>
+                        </div>
+                    </h4>
+                </div>
+                <div id="collapse-{{$index}}" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        <div class="app-interface-block">
+                            @include('partials/interface-block', array( 'interfaceObject' => $interface, 'dataTypes' =>
+                            $dataTypes, 'modules' => $modules) )
+                        </div>
+                    </div>
+                </div>
+            </div>
+            @endforeach
+        </div>
+        @endif
+
+    </div>
+
+    <div class="app-module-block hide">
+        <div class="input-group">
+            <select name="applicationModules[]" class="app-module-select form-control">
+                @foreach( $modules as $index=> $module)
+                <option value="{{ $module->appModuleId}}">{{ $module->appModuleName }}</option>
+                @endforeach
+            </select>
+            <span class="input-group-addon remove-app-module" style="cursor:pointer;">x</span>
+        </div>
+    </div>
+
+    <div class="app-input-block hide">
+        @include('partials/interface-input-block', array( 'dataTypes' => $dataTypes) )
+    </div>
+
+    <div class="app-output-block hide">
+        @include('partials/interface-output-block', array( 'dataTypes' => $dataTypes) )
+    </div>
 </div>
 
-<div class="modal fade" id="edit-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true" data-backdrop="static">
+<div class="modal fade" id="edit-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true" data-backdrop="static">
     <div class="modal-dialog">
-		<form action="{{URL::to('/')}}/app/interface-edit" method="POST" id="edit-app-interface-form">	
-        <div class="modal-content">
-	    	<div class="modal-header">
-	    		<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-	    		<h3 class="text-center">Edit Application Interface</h3>
-	    	</div>
-	    	<div class="modal-body row">
-				<div class="app-interface-form-content col-md-12">
-				</div>
-			</div>
-			<div class="modal-footer">
-	        	<div class="form-group">
-					<input type="button" class="submit-edit-app-interface-form btn btn-primary" value="Update"/>
-					<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					<input type="submit" class="btn btn-primary hide really-submit-edit-app-interface-form" value=""/>
-				</div>
-	        </div>	
-        </div>
+        <form action="{{URL::to('/')}}/app/interface-edit" method="POST" id="edit-app-interface-form">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
+                            aria-hidden="true">&times;</span></button>
+                    <h3 class="text-center">Edit Application Interface</h3>
+                </div>
+                <div class="modal-body row">
+                    <div class="app-interface-form-content col-md-12">
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="button" class="submit-edit-app-interface-form btn btn-primary" value="Update"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                        <input type="submit" class="btn btn-primary hide really-submit-edit-app-interface-form"
+                               value=""/>
+                    </div>
+                </div>
+            </div>
         </form>
     </div>
 </div>
 
-<div class="modal fade" id="create-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true" data-backdrop="static">
+<div class="modal fade" id="create-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true" data-backdrop="static">
     <div class="modal-dialog">
-		<form action="{{URL::to('/')}}/app/interface-create" method="POST" id="create-app-interface-form">	
-        <div class="modal-content">
-	    	<div class="modal-header">
-	    		<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
-	    		<h3 class="text-center">Create Application Interface</h3>
-	    	</div>
-	    	<div class="modal-body row">
-				<div class="col-md-12">
-					<div class="create-app-interface-block">
-						@include('partials/interface-block', array( 'dataTypes' => $dataTypes, 'modules' => $modules) )
-					</div>
-				</div>
-			</div>
-			<div class="modal-footer">
-	        	<div class="form-group">
-					<input type="button" class="btn btn-primary submit-create-app-interface-form" value="Create"/>
-					<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					<input type="submit" class="btn btn-primary hide really-submit-create-app-interface-form" value=""/>
-				</div>
-	        </div>	
-        </div>
+        <form action="{{URL::to('/')}}/app/interface-create" method="POST" id="create-app-interface-form">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
+                            aria-hidden="true">&times;</span></button>
+                    <h3 class="text-center">Create Application Interface</h3>
+                </div>
+                <div class="modal-body row">
+                    <div class="col-md-12">
+                        <div class="create-app-interface-block">
+                            @include('partials/interface-block', array( 'dataTypes' => $dataTypes, 'modules' =>
+                            $modules) )
+                        </div>
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="button" class="btn btn-primary submit-create-app-interface-form" value="Create"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                        <input type="submit" class="btn btn-primary hide really-submit-create-app-interface-form"
+                               value=""/>
+                    </div>
+                </div>
+            </div>
         </form>
     </div>
 </div>
 
-<div class="modal fade" id="delete-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="delete-app-interface-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
 
-		<form action="{{URL::to('/')}}/app/interface-delete" method="POST">
-	        <div class="modal-content">
-	            <div class="modal-header">
-	              	<h3 class="text-center">Delete Confirmation Application Interface</h3>
-	            </div>
-	            <div class="modal-body">
-					<input type="hidden" class="form-control delete-interfaceid" name="appInterfaceId"/>
-			 		Do you really want to delete the Application Interface - <span class="delete-interface-name"></span>
-				</div>
-				<div class="modal-footer">
-					<div class="form-group">
-						<input type="submit" class="btn btn-danger" value="Delete"/>
-						<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					</div>
-				</div>
-			</div>
-
-		</form>
-
-
-	</div>
+        <form action="{{URL::to('/')}}/app/interface-delete" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Delete Confirmation Application Interface</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control delete-interfaceid" name="appInterfaceId"/>
+                    Do you really want to delete the Application Interface - <span class="delete-interface-name"></span>
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Delete"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                    </div>
+                </div>
+            </div>
+
+        </form>
+
+
+    </div>
 </div>
 
 @stop
 
 @section('scripts')
-	@parent
-    {{ HTML::script('js/interface.js') }}
+@parent
+{{ HTML::script('js/interface.js') }}
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/application/module.blade.php
----------------------------------------------------------------------
diff --git a/app/views/application/module.blade.php b/app/views/application/module.blade.php
index 006f330..0f635cb 100644
--- a/app/views/application/module.blade.php
+++ b/app/views/application/module.blade.php
@@ -1,189 +1,202 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/style.css') }}
+@parent
+{{ HTML::style('css/style.css') }}
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-
-		<button class="btn btn-default create-app-module" data-toggle="modal" data-target="#new-app-module-block">Create a new Application Module</button>
-
-	@if( count( $modules) )
-		@if( Session::has("message"))
-			<div class="row">
-				<div class="alert alert-success alert-dismissible" role="alert">
-					<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-					{{ Session::get("message") }}
-				</div>
-			</div>
-			{{ Session::forget("message") }}
-		@endif
-		<div class="row">
-			<div class="col-md-6">
-				<h3>Existing Modules :</h3>
-			</div>
-			<div class="col-md-6" style="margin-top:3.5%">
-				<input type="text" class="col-md-12 filterinput" placeholder="Search by Module Name" />
-			</div>
-		</div>
-		<div class="panel-group" id="accordion">
-		@foreach( $modules as $index => $module )
-			<div class="panel panel-default">
-				<div class="panel-heading">
-					<h4 class="panel-title">
-						<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapse-{{$index}}">
-						{{ $module->appModuleName }}
-						</a>
-						<div class="pull-right col-md-2 module-options fade">
-							<span class="glyphicon glyphicon-pencil edit-app-module" style="cursor:pointer;" data-toggle="modal" data-target="#edit-app-module-block" data-module-data="{{ htmlentities(json_encode( $module) ) }}"></span>
-							<span class="glyphicon glyphicon-trash delete-app-module" style="cursor:pointer;" data-toggle="modal" data-target="#delete-app-module-block" data-module-data="{{ htmlentities(json_encode( $module) ) }}"></span>
-						</div>
-					</h4>
-				</div>
-				<div id="collapse-{{$index}}" class="panel-collapse collapse">
-					<div class="panel-body">
-						{{ $module->appModuleDescription }}
-					</div>
-				</div>
-			</div>
-		@endforeach
-		</div>
-	@endif
-
-
- 	<div class="modal fade" id="new-app-module-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-	    <div class="modal-dialog">
-
-			<form action="{{URL::to('/')}}/app/module-create" method="POST">
-
-		        <div class="modal-content">
-		            <div class="modal-header">
-		              	<h3 class="text-center">Create a new Application Module</h3>
-		            </div>
-		            <div class="modal-body">
-				 		@include('partials/module-block')
-					</div>
-					<div class="modal-footer">
-						<div class="form-group">
-							<input type="submit" class="btn btn-primary" value="Save"/>
-							<input type="reset" class="reset-create-form btn btn-success" value ="Reset"/>
-						</div>
-					</div>
-				</div>
-
-			</form>
-
-
-		</div>
-	</div>
-
-	<div class="modal fade" id="edit-app-module-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-	    <div class="modal-dialog">
-
-			<form action="{{URL::to('/')}}/app/module-edit" method="POST">
-		        <div class="modal-content">
-		            <div class="modal-header">
-		              	<h3 class="text-center">Edit Application Module</h3>
-		            </div>
-		            <div class="modal-body">
-						<input type="hidden" class="form-control edit-moduleid" name="appModuleId"/>
-				 		@include('partials/module-block')
-					</div>
-					<div class="modal-footer">
-						<div class="form-group">
-							<input type="submit" class="btn btn-primary" value="Update"/>
-							<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-						</div>
-					</div>
-				</div>
-
-			</form>
-
-
-		</div>
-	</div>
-
-	<div class="modal fade" id="delete-app-module-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-	    <div class="modal-dialog">
-
-			<form action="{{URL::to('/')}}/app/module-delete" method="POST">
-		        <div class="modal-content">
-		            <div class="modal-header">
-		              	<h3 class="text-center">Delete Confirmation Application Module</h3>
-		            </div>
-		            <div class="modal-body">
-						<input type="hidden" class="form-control delete-moduleid" name="appModuleId"/>
-
-				 		Do you really want to delete the Application Module - <span class="delete-module-name"></span>
-					</div>
-					<div class="modal-footer">
-						<div class="form-group">
-							<input type="submit" class="btn btn-danger" value="Delete"/>
-							<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-						</div>
-					</div>
-				</div>
-
-			</form>
-
-
-		</div>
-	</div>
-
-@stop
-
-@section('scripts')
-	@parent
-	<script type="text/javascript">
-
-		$(".panel-title").hover( 
-			function(){
-				$(this).find(".module-options").addClass("in");
-			},
-			function(){
-				$(this).find(".module-options").removeClass("in");
-			}
-		);
-
-    	$('.filterinput').keyup(function() {
-            var a = $(this).val();
-            if (a.length > 0) {
-                children = ($("#accordion").children());
-
-                var containing = children.filter(function () {
-                    var regex = new RegExp('\\b' + a, 'i');
-                    return regex.test($('a', this).text());
-                }).slideDown();
-                children.not(containing).slideUp();
-            } else {
-                children.slideDown();
-            }
-            return false;
-        });
-
-        $(".create-app-module").click( function(){
-        	//reset form to clear it out if it got filled by edit modules
-        	$(".reset-create-form").click();
-        })
-
-        $(".edit-app-module").click( function(){
-        	var moduleData = $(this).data("module-data");
-        	console.log( moduleData);
-        	$(".edit-name").val( moduleData.appModuleName);
-        	$(".edit-desc").val( moduleData.appModuleDescription);
-        	$(".edit-version").val( moduleData.appModuleVersion);
-        	$(".edit-moduleid").val( moduleData.appModuleId)
-        });
-
-        $(".delete-app-module").click( function(){
-        	var moduleData = $(this).data("module-data");
-        	$(".delete-module-name").html( moduleData.appModuleName);
-        	$(".delete-moduleid").val( moduleData.appModuleId)
-        });
-    </script>
-
-@stop
\ No newline at end of file
+    <div class="col-md-offset-2 col-md-8">
+
+        <button class="btn btn-default create-app-module" data-toggle="modal" data-target="#new-app-module-block">Create
+            a new Application Module
+        </button>
+
+        @if( count( $modules) )
+        @if( Session::has("message"))
+        <div class="row">
+            <div class="alert alert-success alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                        class="sr-only">Close</span></button>
+                {{ Session::get("message") }}
+            </div>
+        </div>
+        {{ Session::forget("message") }}
+        @endif
+        <div class="row">
+            <div class="col-md-6">
+                <h3>Existing Modules :</h3>
+            </div>
+            <div class="col-md-6" style="margin-top:3.5%">
+                <input type="text" class="col-md-12 filterinput" placeholder="Search by Module Name"/>
+            </div>
+        </div>
+        <div class="panel-group" id="accordion">
+            @foreach( $modules as $index => $module )
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion"
+                           href="#collapse-{{$index}}">
+                            {{ $module->appModuleName }}
+                        </a>
+
+                        <div class="pull-right col-md-2 module-options fade">
+                            <span class="glyphicon glyphicon-pencil edit-app-module" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#edit-app-module-block"
+                                  data-module-data="{{ htmlentities(json_encode( $module) ) }}"></span>
+                            <span class="glyphicon glyphicon-trash delete-app-module" style="cursor:pointer;"
+                                  data-toggle="modal" data-target="#delete-app-module-block"
+                                  data-module-data="{{ htmlentities(json_encode( $module) ) }}"></span>
+                        </div>
+                    </h4>
+                </div>
+                <div id="collapse-{{$index}}" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        {{ $module->appModuleDescription }}
+                    </div>
+                </div>
+            </div>
+            @endforeach
+        </div>
+        @endif
+
+
+        <div class="modal fade" id="new-app-module-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+
+                <form action="{{URL::to('/')}}/app/module-create" method="POST">
+
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Create a new Application Module</h3>
+                        </div>
+                        <div class="modal-body">
+                            @include('partials/module-block')
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-primary" value="Save"/>
+                                <input type="reset" class="reset-create-form btn btn-success" value="Reset"/>
+                            </div>
+                        </div>
+                    </div>
+
+                </form>
+
+
+            </div>
+        </div>
+
+        <div class="modal fade" id="edit-app-module-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+
+                <form action="{{URL::to('/')}}/app/module-edit" method="POST">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Edit Application Module</h3>
+                        </div>
+                        <div class="modal-body">
+                            <input type="hidden" class="form-control edit-moduleid" name="appModuleId"/>
+                            @include('partials/module-block')
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-primary" value="Update"/>
+                                <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                            </div>
+                        </div>
+                    </div>
+
+                </form>
+
+
+            </div>
+        </div>
+
+        <div class="modal fade" id="delete-app-module-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+
+                <form action="{{URL::to('/')}}/app/module-delete" method="POST">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Delete Confirmation Application Module</h3>
+                        </div>
+                        <div class="modal-body">
+                            <input type="hidden" class="form-control delete-moduleid" name="appModuleId"/>
+
+                            Do you really want to delete the Application Module - <span
+                                class="delete-module-name"></span>
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-danger" value="Delete"/>
+                                <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                            </div>
+                        </div>
+                    </div>
+
+                </form>
+
+
+            </div>
+        </div>
+
+        @stop
+
+        @section('scripts')
+        @parent
+        <script type="text/javascript">
+
+            $(".panel-title").hover(
+                function () {
+                    $(this).find(".module-options").addClass("in");
+                },
+                function () {
+                    $(this).find(".module-options").removeClass("in");
+                }
+            );
+
+            $('.filterinput').keyup(function () {
+                var a = $(this).val();
+                if (a.length > 0) {
+                    children = ($("#accordion").children());
+
+                    var containing = children.filter(function () {
+                        var regex = new RegExp('\\b' + a, 'i');
+                        return regex.test($('a', this).text());
+                    }).slideDown();
+                    children.not(containing).slideUp();
+                } else {
+                    children.slideDown();
+                }
+                return false;
+            });
+
+            $(".create-app-module").click(function () {
+                //reset form to clear it out if it got filled by edit modules
+                $(".reset-create-form").click();
+            })
+
+            $(".edit-app-module").click(function () {
+                var moduleData = $(this).data("module-data");
+                console.log(moduleData);
+                $(".edit-name").val(moduleData.appModuleName);
+                $(".edit-desc").val(moduleData.appModuleDescription);
+                $(".edit-version").val(moduleData.appModuleVersion);
+                $(".edit-moduleid").val(moduleData.appModuleId)
+            });
+
+            $(".delete-app-module").click(function () {
+                var moduleData = $(this).data("module-data");
+                $(".delete-module-name").html(moduleData.appModuleName);
+                $(".delete-moduleid").val(moduleData.appModuleId)
+            });
+        </script>
+
+        @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/emails/auth/reminder.blade.php
----------------------------------------------------------------------
diff --git a/app/views/emails/auth/reminder.blade.php b/app/views/emails/auth/reminder.blade.php
index aebea9e..59cf733 100755
--- a/app/views/emails/auth/reminder.blade.php
+++ b/app/views/emails/auth/reminder.blade.php
@@ -1,14 +1,14 @@
 <!DOCTYPE html>
 <html lang="en-US">
-	<head>
-		<meta charset="utf-8">
-	</head>
-	<body>
-		<h2>Password Reset</h2>
+<head>
+    <meta charset="utf-8">
+</head>
+<body>
+<h2>Password Reset</h2>
 
-		<div>
-			To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.<br/>
-			This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes.
-		</div>
-	</body>
+<div>
+    To reset your password, complete this form: {{ URL::to('password/reset', array($token)) }}.<br/>
+    This link will expire in {{ Config::get('auth.reminder.expire', 60) }} minutes.
+</div>
+</body>
 </html>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/experiment/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/browse.blade.php b/app/views/experiment/browse.blade.php
index 8e27b85..105a65d 100755
--- a/app/views/experiment/browse.blade.php
+++ b/app/views/experiment/browse.blade.php
@@ -3,45 +3,46 @@
 @section('content')
 
 <div class="container" style="max-width: 750px;">
-<h1>Browse Experiments</h1>
+    <h1>Browse Experiments</h1>
 
-<?php
+    <?php
 
-if (isset( $expContainer))
-{
-?>
+    if (isset($expContainer))
+    {
+    ?>
     <!-- Pagination handling-->
     <form id="paginationForm" action="{{URL::to('/')}}/experiment/browse" method="post" class="form-inline" role="form">
         <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
             <?php
-            if($pageNo!=1){
+            if ($pageNo != 1) {
                 echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
             }
-            if(sizeof($expContainer)>0){
+            if (sizeof($expContainer) > 0) {
                 echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
             }
             ?>
         </div>
         <div class="pull-left">
-            <?php if (sizeof($expContainer) != 0) echo 'Showing results from ' . strval(($pageNo-1)*$limit + 1)
-                . ' to ' . strval(min($pageNo*$limit, ($pageNo-1)*$limit + sizeof($expContainer))); ?>
+            <?php if (sizeof($expContainer) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
+                . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($expContainer))); ?>
         </div>
         <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
+
         <div style="clear: both"></div>
     </form>
 
-<?php
+    <?php
     if (sizeof($expContainer) == 0)
     {
-        if($pageNo==1){
-            Utilities::print_warning_message('No results found. Please try again.');
-        }else{
-            Utilities::print_warning_message('No more results found.');
+        if ($pageNo == 1) {
+            CommonUtilities::print_warning_message('No results found. Please try again.');
+        } else {
+            CommonUtilities::print_warning_message('No more results found.');
         }
     }
     else
     {
-?>
+    ?>
     <div id="re" class="table-responsive">
         <table class="table">
             <tr>
@@ -51,133 +52,122 @@ if (isset( $expContainer))
                 <!--<th>Resource</th>-->
                 <th>Creation Time</th>
                 <th>Status</th>
-<!--                    <select class="form-control select-status">-->
-<!--                        <option value="ALL">Status</option>-->
-<!--                    @foreach( $expStates as $index => $state)-->
-<!--                        <option value="{{ $state }}">{{ $state }}</option>-->
-<!--                    @endforeach-->
-<!--                    </select>-->
-<!--                </th>-->
+                <!--                    <select class="form-control select-status">-->
+                <!--                        <option value="ALL">Status</option>-->
+                <!--                    @foreach( $expStates as $index => $state)-->
+                <!--                        <option value="{{ $state }}">{{ $state }}</option>-->
+                <!--                    @endforeach-->
+                <!--                    </select>-->
+                <!--                </th>-->
             </tr>
-    
-
-<?php
-        foreach ($expContainer as $experiment)
-        {
-            $description = $experiment['experiment']->description;
-            if (strlen($description) > 17) // 17 is arbitrary
-            {
-                $description = substr($experiment['experiment']->description, 0, 17) . '<span class="text-muted">...</span>';
-            }
 
-            echo '<tr>';
-            $addEditOption="";
-            if( $experiment['expValue']['editable'])
-                $addEditOption = '<a href="'. URL::to('/') . '/experiment/edit?expId=' . $experiment['experiment']->experimentID . '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>';
-
-            echo '<td>' . $experiment['experiment']->name .  $addEditOption . '</td>';
-
-            echo '<td>' . $experiment['expValue']['applicationInterface']->applicationName . '</td>';
-
-            echo '<td>' . $description . '</td>';
-
-            //echo "<td>$computeResource->hostName</td>";
-            echo '<td class="time" unix-time="' . $experiment['experiment']->creationTime/1000 . '"></td>';
-
-
-            switch ($experiment['expValue']['experimentStatusString'])
-            {
-                case 'CANCELING':
-                case 'CANCELED':
-                case 'UNKNOWN':
-                    $textClass = 'text-warning';
-                    break;
-                case 'FAILED':
-                    $textClass = 'text-danger';
-                    break;
-                case 'COMPLETED':
-                    $textClass = 'text-success';
-                    break;
-                default:
-                    $textClass = 'text-info';
-                    break;
-            }
 
-        ?>
-            <td>
-                <a class="<?php echo $textClass; ?>" href="{{ URL::to('/') }}/experiment/summary?expId=<?php echo $experiment['experiment']->experimentID; ?>">
-                    <?php echo $experiment['expValue']['experimentStatusString']; ?>
-                </a>
-            </td>
+            <?php
+            foreach ($expContainer as $experiment) {
+                $description = $experiment['experiment']->description;
+                if (strlen($description) > 17) // 17 is arbitrary
+                {
+                    $description = substr($experiment['experiment']->description, 0, 17) . '<span class="text-muted">...</span>';
+                }
 
-            </tr>
+                echo '<tr>';
+                $addEditOption = "";
+                if ($experiment['expValue']['editable'])
+                    $addEditOption = '<a href="' . URL::to('/') . '/experiment/edit?expId=' . $experiment['experiment']->experimentID . '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a>';
 
-        <?php            
-        }
+                echo '<td>' . $experiment['experiment']->name . $addEditOption . '</td>';
 
-        echo '
-            </table>
-            </div>
-            ';
-    }
-}
-?>
+                echo '<td>' . $experiment['expValue']['applicationInterface']->applicationName . '</td>';
+
+                echo '<td>' . $description . '</td>';
+
+                //echo "<td>$computeResource->hostName</td>";
+                echo '<td class="time" unix-time="' . $experiment['experiment']->creationTime / 1000 . '"></td>';
+
+
+                switch ($experiment['expValue']['experimentStatusString']) {
+                    case 'CANCELING':
+                    case 'CANCELED':
+                    case 'UNKNOWN':
+                        $textClass = 'text-warning';
+                        break;
+                    case 'FAILED':
+                        $textClass = 'text-danger';
+                        break;
+                    case 'COMPLETED':
+                        $textClass = 'text-success';
+                        break;
+                    default:
+                        $textClass = 'text-info';
+                        break;
+                }
+
+                ?>
+                <td>
+                    <a class="<?php echo $textClass; ?>"
+                       href="{{ URL::to('/') }}/experiment/summary?expId=<?php echo $experiment['experiment']->experimentID; ?>">
+                        <?php echo $experiment['expValue']['experimentStatusString']; ?>
+                    </a>
+                </td>
+                </tr>
+            <?php
+            }
+            }
+            }
+            ?>
+        </table>
+    </div>
 </div>
 
 @stop
 
 @section('scripts')
-    @parent
-    {{ HTML::script('js/time-conversion.js')}}
-    <script type="text/javascript">
+@parent
+{{ HTML::script('js/time-conversion.js')}}
+<script type="text/javascript">
 
-        $(document).ready( function(){
+    $(document).ready(function () {
 
-            /* script to make status select work on the UI side itself. */
+        /* script to make status select work on the UI side itself. */
 
-            $(".select-status").on("change", function(){
-                selectedStatus = this.value;
+        $(".select-status").on("change", function () {
+            selectedStatus = this.value;
 
-                if( selectedStatus == "ALL")
-                {
-                    $("table tr").slideDown();
-                }
-                else
-                {
-                    $("table tr").each(function(index) {
-                        if (index != 0) {
-
-                            $row = $(this);
-
-                            var status = $.trim( $row.find("td:last").text() );
-                            if (status == selectedStatus )
-                            {
-                                $(this).slideDown();
-                            }
-                            else {
-                                $(this).slideUp();
-                            }
+            if (selectedStatus == "ALL") {
+                $("table tr").slideDown();
+            }
+            else {
+                $("table tr").each(function (index) {
+                    if (index != 0) {
+
+                        $row = $(this);
+
+                        var status = $.trim($row.find("td:last").text());
+                        if (status == selectedStatus) {
+                            $(this).slideDown();
                         }
-                    });
-                }
-            });
+                        else {
+                            $(this).slideUp();
+                        }
+                    }
+                });
+            }
         });
+    });
 
-    function changeInputVisibility( selectedStatus)
-    {
-        if( selectedStatus == "creation-time")
-        {
+    function changeInputVisibility(selectedStatus) {
+        if (selectedStatus == "creation-time") {
             $(".search-text-block").addClass("hide");
             $(".select-dates").removeClass("hide");
             $("#search-value").removeAttr("required");
 
         }
-        else
-        {
+        else {
             $(".search-text-block").removeClass("hide");
             $(".select-dates").addClass("hide");
             $("#search-value").attr("required");
         }
     }
-    </script>
+</script>
+
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/experiment/create-complete.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/create-complete.blade.php b/app/views/experiment/create-complete.blade.php
index d5d944d..06e8f31 100644
--- a/app/views/experiment/create-complete.blade.php
+++ b/app/views/experiment/create-complete.blade.php
@@ -1,13 +1,14 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 <div class="col-md-offset-3 col-md-6">
-    
+
     <h1>Create a new experiment</h1>
+
     <form action="{{URL::to('/')}}/experiment/create" method="POST" role="form" enctype="multipart/form-data">
 
         <input type="hidden" name="experiment-name" value="{{$expInputs['experimentName']}}">
@@ -15,19 +16,22 @@
         <input type="hidden" name="project" value="{{$expInputs['project']}}">
         <input type="hidden" name="application" value="{{$expInputs['application']}}">
 
-        @include('partials/experiment-inputs', array("expInputs" => $expInputs, "queueDefaults" => $expInputs['queueDefaults']) )
+        @include('partials/experiment-inputs', array("expInputs" => $expInputs, "queueDefaults" =>
+        $expInputs['queueDefaults']) )
 
         <div class="form-group btn-toolbar">
             <div class="btn-group">
                 <button name="save" type="submit" class="btn btn-primary" value="Save">Save</button>
-                <button name="launch" type="submit" class="btn btn-success" id="expLaunch" value="Save and launch">Save and launch</button>
+                <button name="launch" type="submit" class="btn btn-success" id="expLaunch" value="Save and launch">Save
+                    and launch
+                </button>
             </div>
-            
+
             <a href="{{URL::to('/')}}/experiment/create" class="btn btn-default" role="button">Start over</a>
         </div>
-        
+
     </form>
-        
+
 
 </div>
 
@@ -35,50 +39,47 @@
 @stop
 
 @section('scripts')
-    @parent
-    <script>
-    $('.file-input').bind('change', function() {
-
-        var inputFileSize = Math.round( this.files[0].size/(1024*1024) );
-        if( inputFileSize > $("#allowedFileSize").val())
-        {
-            alert( "The input file size is greater than the allowed file size (" + $("#allowedFileSize").val() + " MB) in a form. Please upload another file.");
+@parent
+<script>
+    $('.file-input').bind('change', function () {
+
+        var inputFileSize = Math.round(this.files[0].size / (1024 * 1024));
+        if (inputFileSize > $("#allowedFileSize").val()) {
+            alert("The input file size is greater than the allowed file size (" + $("#allowedFileSize").val() + " MB) in a form. Please upload another file.");
             $(this).val("");
         }
 
     });
 
-    $("#enableEmail").change( function(){
-        if( this.checked)
-        {
+    $("#enableEmail").change(function () {
+        if (this.checked) {
             $("#emailAddresses").attr("required", "required");
             $(this).parent().children(".emailSection").removeClass("hide");
         }
-        else
-        {
+        else {
             $(this).parent().children(".emailSection").addClass("hide");
             $("#emailAddresses").removeAttr("required");
         }
 
     });
 
-    $(".addEmail").click( function(){
+    $(".addEmail").click(function () {
         var emailInput = $(this).parent().find("#emailAddresses").clone();
         emailInput.removeAttr("id").removeAttr("required").val("").appendTo(".emailAddresses");
     });
 
-    $("#compute-resource").change( function(){
+    $("#compute-resource").change(function () {
         var crId = $(this).val();
         $(".loading-img ").removeClass("hide");
         $.ajax({
             url: '../experiment/getQueueView',
             type: 'get',
             data: {crId: crId},
-            success: function(data) {
-                $(".queue-view").html( data);
+            success: function (data) {
+                $(".queue-view").html(data);
                 $(".loading-img ").addClass("hide");
             }
         });
     });
-    </script>
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/experiment/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/create.blade.php b/app/views/experiment/create.blade.php
index 52873f1..1318460 100755
--- a/app/views/experiment/create.blade.php
+++ b/app/views/experiment/create.blade.php
@@ -1,17 +1,17 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 <div class="col-md-offset-3 col-md-6">
-    
+
     <h1>Create a new experiment</h1>
 
     <form action="{{URL::to('/')}}/experiment/create" method="POST" role="form" enctype="multipart/form-data">
 
-    <?php
+        <?php
 
         $disabled = '';
         $experimentName = '';
@@ -21,33 +21,35 @@
 
         $echo = '';
         $wrf = '';
-    ?>
+        ?>
 
         <div class="form-group required">
             <label for="experiment-name" class="control-label">Experiment Name</label>
-            <input type="text" class="form-control" name="experiment-name" id="experiment-name" placeholder="Enter experiment name" autofocus required="required">
+            <input type="text" class="form-control" name="experiment-name" id="experiment-name"
+                   placeholder="Enter experiment name" autofocus required="required">
         </div>
         <div class="form-group">
             <label for="experiment-description">Experiment Description</label>
-            <textarea class="form-control" name="experiment-description" id="experiment-description" placeholder="Optional: Enter a short description of the experiment"></textarea>
+            <textarea class="form-control" name="experiment-description" id="experiment-description"
+                      placeholder="Optional: Enter a short description of the experiment"></textarea>
         </div>
         <div class="form-group required">
             <label for="project" class="control-label">Project</label>
 
 
-        {{ Utilities::create_project_select($project, !$disabled) }}
+            {{ ProjectUtilities::create_project_select($project, !$disabled) }}
 
         </div>
-            <div class="form-group">
+        <div class="form-group">
             <label for="application">Application</label>
 
-            {{ Utilities::create_application_select($application, !$disabled) }}
+            {{ ExperimentUtilities::create_application_select($application, !$disabled) }}
 
         </div>
         <div class="btn-toolbar">
             <input name="continue" type="submit" class="btn btn-primary" value="Continue">
             <input name="clear" type="reset" class="btn btn-default" value="Reset values">
-        </div>   
+        </div>
     </form>
 
 </div>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/experiment/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/experiment/edit.blade.php b/app/views/experiment/edit.blade.php
index 8eb759a..b4ee28c 100755
--- a/app/views/experiment/edit.blade.php
+++ b/app/views/experiment/edit.blade.php
@@ -1,7 +1,7 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
@@ -16,25 +16,27 @@
 
 <div class="container">
 
-  <div class="col-md-offset-3 col-md-6">
-    <h1>Edit Cloned Experiment</h1>
+    <div class="col-md-offset-3 col-md-6">
+        <h1>Edit Cloned Experiment</h1>
 
-    <form action="{{URL::to('/')}}/experiment/edit" method="POST" role="form" enctype="multipart/form-data">
-        <input type="hidden" name="expId" value="<?php echo Input::get('expId');?>"/>
+        <form action="{{URL::to('/')}}/experiment/edit" method="POST" role="form" enctype="multipart/form-data">
+            <input type="hidden" name="expId" value="<?php echo Input::get('expId'); ?>"/>
 
-        @include('partials/experiment-inputs')
+            @include('partials/experiment-inputs')
 
 
-        <div class="btn-toolbar">
-            <div class="btn-group">
-                <input name="save" type="submit" class="btn btn-primary" value="Save" <?php if(!$expInputs['expVal']['editable']) echo 'disabled'  ?>>
-                <input name="launch" type="submit" class="btn btn-success" value="Save and launch" <?php if(!$expInputs['expVal']['editable']) echo 'disabled'  ?>>
+            <div class="btn-toolbar">
+                <div class="btn-group">
+                    <input name="save" type="submit" class="btn btn-primary"
+                           value="Save" <?php if (!$expInputs['expVal']['editable']) echo 'disabled' ?>>
+                    <input name="launch" type="submit" class="btn btn-success"
+                           value="Save and launch" <?php if (!$expInputs['expVal']['editable']) echo 'disabled' ?>>
+                </div>
             </div>
-        </div>
 
 
-    </form>
-  </div>
+        </form>
+    </div>
 
 </div>
 
@@ -42,36 +44,33 @@
 
 
 @section('scripts')
-    @parent
-    <script>
-    $('.file-input').bind('change', function() {
-
-        var inputFileSize = Math.round( this.files[0].size/(1024*1024) );
-        if( inputFileSize > $("#allowedFileSize").val())
-        {
-            alert( "The input file size is greater than the allowed file size (" + $("#allowedFileSize").val() + " MB) in a form. Please upload another file.");
+@parent
+<script>
+    $('.file-input').bind('change', function () {
+
+        var inputFileSize = Math.round(this.files[0].size / (1024 * 1024));
+        if (inputFileSize > $("#allowedFileSize").val()) {
+            alert("The input file size is greater than the allowed file size (" + $("#allowedFileSize").val() + " MB) in a form. Please upload another file.");
             $(this).val("");
         }
 
     });
 
-    $("#enableEmail").change( function(){
-      if( this.checked)
-        {
+    $("#enableEmail").change(function () {
+        if (this.checked) {
             $("#emailAddresses").attr("required", "required");
-        $(this).parent().children(".emailSection").removeClass("hide");
+            $(this).parent().children(".emailSection").removeClass("hide");
         }
-      else
-        {
-        $(this).parent().children(".emailSection").addClass("hide");
+        else {
+            $(this).parent().children(".emailSection").addClass("hide");
             $("#emailAddresses").removeAttr("required");
         }
 
     });
 
-    $(".addEmail").click( function(){
-      var emailInput = $(this).parent().find("#emailAddresses").clone();
-      emailInput.removeAttr("id").removeAttr("required").val("").appendTo(".emailAddresses");
+    $(".addEmail").click(function () {
+        var emailInput = $(this).parent().find("#emailAddresses").clone();
+        emailInput.removeAttr("id").removeAttr("required").val("").appendTo(".emailAddresses");
     });
-    </script>
+</script>
 @stop
\ No newline at end of file


[09/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/AppUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AppUtilities.php b/app/libraries/AppUtilities.php
index e485a36..5ceb44a 100644
--- a/app/libraries/AppUtilities.php
+++ b/app/libraries/AppUtilities.php
@@ -1,205 +1,327 @@
 <?php
 
 //Airavata classes - loaded from app/libraries/Airavata
-use Airavata\Model\AppCatalog\AppInterface\DataType;
-use Airavata\Model\AppCatalog\AppInterface\InputDataObjectType;
-use Airavata\Model\AppCatalog\AppInterface\OutputDataObjectType;
-use Airavata\Model\AppCatalog\AppInterface\ApplicationInterfaceDescription;
+use Airavata\Model\AppCatalog\AppDeployment\ApplicationDeploymentDescription;
 use Airavata\Model\AppCatalog\AppDeployment\ApplicationModule;
 use Airavata\Model\AppCatalog\AppDeployment\ApplicationParallelismType;
-use Airavata\Model\AppCatalog\AppDeployment\ApplicationDeploymentDescription;
 use Airavata\Model\AppCatalog\AppDeployment\SetEnvPaths;
+use Airavata\Model\AppCatalog\AppInterface\ApplicationInterfaceDescription;
+use Airavata\Model\AppCatalog\AppInterface\DataType;
+use Airavata\Model\AppCatalog\AppInterface\InputDataObjectType;
+use Airavata\Model\AppCatalog\AppInterface\OutputDataObjectType;
+
+
+class AppUtilities
+{
+
+    public static function create_or_update_appModule($inputs, $update = false)
+    {
+
+        $appModule = new ApplicationModule(array(
+            "appModuleName" => $inputs["appModuleName"],
+            "appModuleVersion" => $inputs["appModuleVersion"],
+            "appModuleDescription" => $inputs["appModuleDescription"]
+        ));
+
+        if ($update)
+            return Airavata::updateApplicationModule($inputs["appModuleId"], $appModule);
+        else
+            return Airavata::registerApplicationModule(Session::get("gateway_id"), $appModule);
+    }
+
+    public static function deleteAppModule($appModuleId)
+    {
+
+        return Airavata::deleteApplicationModule($appModuleId);
+    }
+
+    public static function getAppInterfaceData()
+    {
+
+        $dataType = new DataType();
+        $modules = AppUtilities::getAllModules();
+        $appInterfaces = Airavata::getAllApplicationInterfaces(Session::get("gateway_id"));
+
+
+        $InputDataObjectType = new InputDataObjectType();
+
+        return array(
+            "appInterfaces" => $appInterfaces,
+            "dataTypes" => $dataType::$__names,
+            "modules" => $modules
+        );
+    }
+
+    public static function create_or_update_appInterface($appInterfaceValues, $update = false)
+    {
+
+        //var_dump( $appInterfaceValues); exit;
+        $appInterface = new ApplicationInterfaceDescription(array(
+            "applicationName" => $appInterfaceValues["applicationName"],
+            "applicationDescription" => $appInterfaceValues["applicationDescription"],
+            "applicationModules" => $appInterfaceValues["applicationModules"]
+        ));
+
+        if (isset($appInterfaceValues["inputName"])) {
+            foreach ($appInterfaceValues["inputName"] as $index => $name) {
+                $inputDataObjectType = new InputDataObjectType(array(
+                    "name" => $name,
+                    "value" => $appInterfaceValues["inputValue"][$index],
+                    "type" => $appInterfaceValues["inputType"][$index],
+                    "applicationArgument" => $appInterfaceValues["applicationArgumentInput"][$index],
+                    "standardInput" => $appInterfaceValues["standardInput"][$index],
+                    "userFriendlyDescription" => $appInterfaceValues["userFriendlyDescription"][$index],
+                    "metaData" => $appInterfaceValues["metaData"][$index],
+                    "inputOrder" => intval($appInterfaceValues["inputOrder"][$index]),
+                    "dataStaged" => intval($appInterfaceValues["dataStaged"][$index]),
+                    "isRequired" => $appInterfaceValues["isRequiredInput"][$index],
+                    "requiredToAddedToCommandLine" => $appInterfaceValues["requiredToAddedToCommandLineInput"][$index]
+                ));
+                $appInterface->applicationInputs[] = $inputDataObjectType;
+            }
+        }
+
+        if (isset($appInterfaceValues["outputName"])) {
+            foreach ($appInterfaceValues["outputName"] as $index => $name) {
+                $outputDataObjectType = new OutputDataObjectType(array(
+                    "name" => $name,
+                    "value" => $appInterfaceValues["outputValue"][$index],
+                    "type" => $appInterfaceValues["outputType"][$index],
+                    "applicationArgument" => $appInterfaceValues["applicationArgumentOutput"][$index],
+                    "dataMovement" => intval($appInterfaceValues["dataMovement"][$index]),
+                    "location" => $appInterfaceValues["location"][$index],
+                    "isRequired" => $appInterfaceValues["isRequiredOutput"][$index],
+                    "requiredToAddedToCommandLine" => $appInterfaceValues["requiredToAddedToCommandLineOutput"][$index],
+                    "searchQuery" => $appInterfaceValues["searchQuery"][$index]
+                ));
+                $appInterface->applicationOutputs[] = $outputDataObjectType;
+            }
+        }
+
+        //var_dump( $appInterface); exit;
+
+        if ($update)
+            Airavata::updateApplicationInterface($appInterfaceValues["app-interface-id"], $appInterface);
+        else
+            Airavata::getApplicationInterface(Airavata::registerApplicationInterface(Session::get("gateway_id"), $appInterface));
+
+        //print_r( "App interface has been created.");
+    }
+
+    public static function deleteAppInterface($appInterfaceId)
+    {
+        return Airavata::deleteApplicationInterface($appInterfaceId);
+    }
+
+
+    public static function getAppDeploymentData()
+    {
+
+        $appDeployments = Airavata::getAllApplicationDeployments(Session::get("gateway_id"));
+        //var_dump( $appDeployments); exit;
+        $computeResources = Airavata::getAllComputeResourceNames();
+        $modules = AppUtilities::getAllModules();
+        $apt = new ApplicationParallelismType();
+
+        return array(
+            "appDeployments" => $appDeployments,
+            "applicationParallelismTypes" => $apt::$__names,
+            "computeResources" => $computeResources,
+            "modules" => $modules
+        );
+    }
+
+    public static function create_or_update_appDeployment($inputs, $update = false)
+    {
+
+        $appDeploymentValues = $inputs;
+
+        if (isset($appDeploymentValues["moduleLoadCmds"]))
+            $appDeploymentValues["moduleLoadCmds"] = array_unique(array_filter($appDeploymentValues["moduleLoadCmds"]));
+
+        if (isset($appDeploymentValues["libraryPrependPathName"])) {
+            $libPrependPathNames = array_unique(array_filter($appDeploymentValues["libraryPrependPathName"], "trim"));
+
+            foreach ($libPrependPathNames as $index => $prependName) {
+                $envPath = new SetEnvPaths(array(
+                    "name" => $prependName,
+                    "value" => $appDeploymentValues["libraryPrependPathValue"][$index]
+                ));
+                $appDeploymentValues["libPrependPaths"][] = $envPath;
+            }
+        }
+
+        if (isset($appDeploymentValues["libraryAppendPathName"])) {
+            $libAppendPathNames = array_unique(array_filter($appDeploymentValues["libraryAppendPathName"], "trim"));
+            foreach ($libAppendPathNames as $index => $appendName) {
+                $envPath = new SetEnvPaths(array(
+                    "name" => $appendName,
+                    "value" => $appDeploymentValues["libraryAppendPathValue"][$index]
+                ));
+                $appDeploymentValues["libAppendPaths"][] = $envPath;
+            }
+        }
+
+        if (isset($appDeploymentValues["environmentName"])) {
+            $environmentNames = array_unique(array_filter($appDeploymentValues["environmentName"], "trim"));
+            foreach ($environmentNames as $index => $envName) {
+                $envPath = new SetEnvPaths(array(
+                    "name" => $envName,
+                    "value" => $appDeploymentValues["environmentValue"][$index]
+                ));
+                $appDeploymentValues["setEnvironment"][] = $envPath;
+            }
+        }
+
+        if (isset($appDeploymentValues["preJobCommand"])) {
+            $appDeploymentValues["preJobCommands"] = array_unique(array_filter($appDeploymentValues["preJobCommand"], "trim"));
+        }
+
+        if (isset($appDeploymentValues["postJobCommand"])) {
+            $appDeploymentValues["postJobCommands"] = array_unique(array_filter($appDeploymentValues["postJobCommand"], "trim"));
+        }
+
+        //var_dump( $appDeploymentValues); exit;
+        $appDeployment = new ApplicationDeploymentDescription($appDeploymentValues);
+        if ($update)
+            Airavata::updateApplicationDeployment($inputs["app-deployment-id"], $appDeployment);
+        else
+            $appDeploymentId = Airavata::registerApplicationDeployment(Session::get("gateway_id"), $appDeployment);
+
+        return;
+
+    }
+
+    public static function deleteAppDeployment($appDeploymentId)
+    {
+        return Airavata::deleteApplicationDeployment($appDeploymentId);
+    }
+
+    public static function getAllModules()
+    {
+        return Airavata::getAllAppModules(Session::get("gateway_id"));
+    }
+
+    /**
+     * Get all available applications
+     * @return null
+     */
+    public static function get_all_applications()
+    {
+        $applications = null;
+
+        try {
+            $applications = Airavata::getAllApplicationInterfaceNames(Session::get("gateway_id"));
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting all applications.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting all applications.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_warning_message('<p>You must create an application module, interface and deployment space before you can create an experiment.
+                Click <a href="' . URL::to('/') . '/app/module">here</a> to create an application.</p>');
+            /*
+            Utilities::print_error_message('<p>There was a problem getting all applications.
+                Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+                */
+        }
+
+        if (count($applications) == 0)
+            CommonUtilities::print_warning_message('<p>You must create an application module, interface and deployment space before you can create an experiment.
+                Click <a href="' . URL::to('/') . '/app/module">here</a> to create an application.</p>');
+
+
+        return $applications;
+    }
+
+    /**
+     * Get the interface for the application with the given ID
+     * @param $id
+     * @return null
+     */
+    public static function get_application_interface($id)
+    {
+        $applicationInterface = null;
+
+        try {
+            $applicationInterface = Airavata::getApplicationInterface($id);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the application interface.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the application interface.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the application interface.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+        }
+
+        return $applicationInterface;
+    }
+
+    /**
+     * Get a list of the inputs for the application with the given ID
+     * @param $id
+     * @return null
+     */
+    public static function get_application_inputs($id)
+    {
+        $inputs = null;
+
+        try {
+            $inputs = Airavata::getApplicationInputs($id);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting application inputs.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting application inputs.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting application inputs.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+        }
+
+        return $inputs;
+    }
+
+
+    /**
+     * Get a list of the outputs for the application with the given ID
+     * @param $id
+     * @return null
+     */
+    public static function get_application_outputs($id)
+    {
+        $outputs = null;
+
+        try {
+            $outputs = Airavata::getApplicationOutputs($id);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting application outputs.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting application outputs.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting application outputs.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+        }
+
+        return $outputs;
+    }
 
 
-class AppUtilities{
-
-	public static function create_or_update_appModule( $inputs, $update = false){
-
-		$appModule = new ApplicationModule( array(
-												"appModuleName" => $inputs["appModuleName"],
-												"appModuleVersion" => $inputs["appModuleVersion"],
-												"appModuleDescription" => $inputs["appModuleDescription"]
-										));
-		
-		if( $update)
-			return Airavata::updateApplicationModule( $inputs["appModuleId"], $appModule);
-		else
-			return Airavata::registerApplicationModule( Session::get("gateway_id"), $appModule);
-	}
-
-	public static function deleteAppModule( $appModuleId){
-
-		return Airavata::deleteApplicationModule( $appModuleId);
-	}
-
-	public static function getAppInterfaceData(){
-
-		$dataType = new DataType();
-		$modules = AppUtilities::getAllModules();
-		$appInterfaces = Airavata::getAllApplicationInterfaces( Session::get("gateway_id"));
-
-
-		$InputDataObjectType = new InputDataObjectType();
-
-		return array(
-						"appInterfaces" 	=> $appInterfaces,
-						"dataTypes" 		=> $dataType::$__names,
-						"modules"   		=> $modules
-						);
-	}
-
-	public static function create_or_update_appInterface( $appInterfaceValues, $update = false){
-
-		//var_dump( $appInterfaceValues); exit;
-		$appInterface = new ApplicationInterfaceDescription( array(
-																"applicationName" => $appInterfaceValues["applicationName"],
-																"applicationDescription" => $appInterfaceValues["applicationDescription"],
-																"applicationModules" => $appInterfaceValues["applicationModules"]
-															) ); 
-
-		if( isset( $appInterfaceValues["inputName"]))
-		{
-			foreach ($appInterfaceValues["inputName"] as $index => $name) {
-				$inputDataObjectType = new InputDataObjectType( array(
-																	"name" => $name,
-																	"value" => $appInterfaceValues["inputValue"][ $index],
-																	"type" => $appInterfaceValues["inputType"][ $index],
-																	"applicationArgument" => $appInterfaceValues["applicationArgumentInput"][$index],
-																	"standardInput" => $appInterfaceValues["standardInput"][ $index],
-																	"userFriendlyDescription" => $appInterfaceValues["userFriendlyDescription"][ $index],
-																	"metaData" => $appInterfaceValues["metaData"][ $index],
-																	"inputOrder" => intval( $appInterfaceValues["inputOrder"][ $index]),
-																	"dataStaged" => intval( $appInterfaceValues["dataStaged"][ $index]),
-																	"isRequired" => $appInterfaceValues["isRequiredInput"][ $index],
-																	"requiredToAddedToCommandLine" => $appInterfaceValues["requiredToAddedToCommandLineInput"][$index]
-																) );
-				$appInterface->applicationInputs[] = $inputDataObjectType;
-			}
-		}
-
-		if( isset( $appInterfaceValues["outputName"]))
-		{
-			foreach ( $appInterfaceValues["outputName"] as $index => $name) {
-				$outputDataObjectType = new OutputDataObjectType( array(
-																	"name" => $name,
-																	"value" => $appInterfaceValues["outputValue"][ $index],
-																	"type" => $appInterfaceValues["outputType"][ $index],
-																	"applicationArgument" => $appInterfaceValues["applicationArgumentOutput"][$index],
-																	"dataMovement" => intval( $appInterfaceValues["dataMovement"][ $index]),
-																	"location" => $appInterfaceValues["location"][ $index],
-																	"isRequired" => $appInterfaceValues["isRequiredOutput"][ $index],
-																	"requiredToAddedToCommandLine" => $appInterfaceValues["requiredToAddedToCommandLineOutput"][$index],
-																	"searchQuery" => $appInterfaceValues["searchQuery"][$index]
-																));
-				$appInterface->applicationOutputs[] = $outputDataObjectType;
-			}
-		}
-
-		//var_dump( $appInterface); exit;
-
-		if( $update)
-            Airavata::updateApplicationInterface( $appInterfaceValues["app-interface-id"], $appInterface);
-		else
-            Airavata::getApplicationInterface(Airavata::registerApplicationInterface( Session::get("gateway_id"), $appInterface) );
-
-		//print_r( "App interface has been created.");
-	}
-
-	public static function deleteAppInterface( $appInterfaceId){
-		return Airavata::deleteApplicationInterface( $appInterfaceId);
-	}
-
-
-	public static function getAppDeploymentData(){
-
-		$appDeployments = Airavata::getAllApplicationDeployments( Session::get("gateway_id"));
-		//var_dump( $appDeployments); exit;
-		$computeResources = Airavata::getAllComputeResourceNames();
-		$modules = AppUtilities::getAllModules();
-		$apt = new ApplicationParallelismType();
-
-		return array( 
-						"appDeployments" 			  => $appDeployments,
-						"applicationParallelismTypes" => $apt::$__names,
-						"computeResources"            => $computeResources,
-						"modules"			          => $modules
-					);
-	}
-
-	public static function create_or_update_appDeployment( $inputs, $update = false){
-
-		$appDeploymentValues = $inputs;
-
-		if( isset( $appDeploymentValues["moduleLoadCmds"]))
-			$appDeploymentValues["moduleLoadCmds"] = array_unique( array_filter( $appDeploymentValues["moduleLoadCmds"]));
-
-		if( isset( $appDeploymentValues["libraryPrependPathName"] )) 
-		{	
-			$libPrependPathNames = array_unique( array_filter( $appDeploymentValues["libraryPrependPathName"],"trim" ));
-		
-			foreach( $libPrependPathNames as $index => $prependName)
-			{
-				$envPath = new SetEnvPaths(array(
-												"name" => $prependName,
-												"value" => $appDeploymentValues["libraryPrependPathValue"][ $index]
-											));
-				$appDeploymentValues["libPrependPaths"][] = $envPath;
-			}
-		}
-
-		if( isset( $appDeploymentValues["libraryAppendPathName"] )) 
-		{
-			$libAppendPathNames = array_unique( array_filter( $appDeploymentValues["libraryAppendPathName"],"trim" ));
-			foreach( $libAppendPathNames as $index => $appendName)
-			{
-				$envPath = new SetEnvPaths(array(
-												"name" => $appendName,
-												"value" => $appDeploymentValues["libraryAppendPathValue"][ $index]
-											));
-				$appDeploymentValues["libAppendPaths"][] = $envPath;
-			}
-		}
-
-		if( isset( $appDeploymentValues["environmentName"] )) 
-		{
-			$environmentNames = array_unique( array_filter( $appDeploymentValues["environmentName"], "trim"));
-			foreach( $environmentNames as $index => $envName)
-			{
-				$envPath = new SetEnvPaths(array(
-												"name" => $envName,
-												"value" => $appDeploymentValues["environmentValue"][$index]
-											));
-				$appDeploymentValues["setEnvironment"][] = $envPath;
-			}
-		}
-		
-		if( isset( $appDeploymentValues["preJobCommand"] )) 
-		{
-			$appDeploymentValues["preJobCommands"] = array_unique( array_filter( $appDeploymentValues["preJobCommand"], "trim"));
-		}
-
-		if( isset( $appDeploymentValues["postJobCommand"] )) 
-		{
-			$appDeploymentValues["postJobCommands"] = array_unique( array_filter( $appDeploymentValues["postJobCommand"], "trim"));
-		}
-
-		//var_dump( $appDeploymentValues); exit;
-		$appDeployment = new ApplicationDeploymentDescription(  $appDeploymentValues);
-		if( $update)
-            Airavata::updateApplicationDeployment( $inputs["app-deployment-id"], $appDeployment);
-		else
-			$appDeploymentId = Airavata::registerApplicationDeployment( Session::get("gateway_id"), $appDeployment);
-
-		return;
-
-	}
-
-	public static function deleteAppDeployment( $appDeploymentId )
-	{
-		return Airavata::deleteApplicationDeployment( $appDeploymentId);
-	}
-
-	public static function getAllModules(){
-		return Airavata::getAllAppModules( Session::get("gateway_id"));
-	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/CRUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CRUtilities.php b/app/libraries/CRUtilities.php
index 308bcdb..688c1de 100755
--- a/app/libraries/CRUtilities.php
+++ b/app/libraries/CRUtilities.php
@@ -3,433 +3,481 @@
 
 //Airavata classes - loaded from app/libraries/Airavata
 //Compute Resource classes
+use Airavata\Model\AppCatalog\ComputeResource\BatchQueue;
+use Airavata\Model\AppCatalog\ComputeResource\ComputeResourceDescription;
+use Airavata\Model\AppCatalog\ComputeResource\DataMovementProtocol;
 use Airavata\Model\AppCatalog\ComputeResource\FileSystems;
+use Airavata\Model\AppCatalog\ComputeResource\GridFTPDataMovement;
+use Airavata\Model\AppCatalog\ComputeResource\JobManagerCommand;
 use Airavata\Model\AppCatalog\ComputeResource\JobSubmissionProtocol;
-use Airavata\Model\AppCatalog\ComputeResource\SecurityProtocol;
+use Airavata\Model\AppCatalog\ComputeResource\LOCALDataMovement;
+use Airavata\Model\AppCatalog\ComputeResource\LOCALSubmission;
+use Airavata\Model\AppCatalog\ComputeResource\MonitorMode;
 use Airavata\Model\AppCatalog\ComputeResource\ResourceJobManager;
 use Airavata\Model\AppCatalog\ComputeResource\ResourceJobManagerType;
-use Airavata\Model\AppCatalog\ComputeResource\JobManagerCommand;
-use Airavata\Model\AppCatalog\ComputeResource\DataMovementProtocol;
-use Airavata\Model\AppCatalog\ComputeResource\ComputeResourceDescription;
-use Airavata\Model\AppCatalog\ComputeResource\SSHJobSubmission;
-use Airavata\Model\AppCatalog\ComputeResource\LOCALSubmission;
-use Airavata\Model\AppCatalog\ComputeResource\UnicoreJobSubmission;
-use Airavata\Model\AppCatalog\ComputeResource\BatchQueue;
 use Airavata\Model\AppCatalog\ComputeResource\SCPDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\GridFTPDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\LOCALDataMovement;
+use Airavata\Model\AppCatalog\ComputeResource\SecurityProtocol;
+use Airavata\Model\AppCatalog\ComputeResource\SSHJobSubmission;
 use Airavata\Model\AppCatalog\ComputeResource\UnicoreDataMovement;
-use Airavata\Model\AppCatalog\ComputeResource\MonitorMode;
-
-//Gateway Classes
-use Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile;
+use Airavata\Model\AppCatalog\ComputeResource\UnicoreJobSubmission;
 use Airavata\Model\AppCatalog\GatewayProfile\ComputeResourcePreference;
+use Airavata\Model\AppCatalog\GatewayProfile\GatewayResourceProfile;
 
+//Gateway Classes
 
 
-
-class CRUtilities{
-/**
- * Basic utility functions
- */
+class CRUtilities
+{
+    /**
+     * Basic utility functions
+     */
 
 //define('ROOT_DIR', __DIR__);
 
-/**
- * Define configuration constants
- */
-public static function register_or_update_compute_resource( $computeDescription, $update = false)
-{
-    if( $update)
+    /**
+     * Define configuration constants
+     */
+    public static function register_or_update_compute_resource($computeDescription, $update = false)
     {
-        $computeResourceId = $computeDescription->computeResourceId;
-
-        if( Airavata::updateComputeResource( $computeResourceId, $computeDescription) )
-        {
-            $computeResource = Airavata::getComputeResource( $computeResourceId);
-            return $computeResource;
+        if ($update) {
+            $computeResourceId = $computeDescription->computeResourceId;
+
+            if (Airavata::updateComputeResource($computeResourceId, $computeDescription)) {
+                $computeResource = Airavata::getComputeResource($computeResourceId);
+                return $computeResource;
+            } else
+                print_r("Something went wrong while updating!");
+            exit;
+        } else {
+            /*
+            $fileSystems = new FileSystems();
+            foreach( $fileSystems as $fileSystem)
+                $computeDescription["fileSystems"][$fileSystem] = "";
+            */
+            $cd = new ComputeResourceDescription($computeDescription);
+            $computeResourceId = Airavata::registerComputeResource($cd);
         }
-        else
-            print_r( "Something went wrong while updating!"); exit;
+
+        $computeResource = Airavata::getComputeResource($computeResourceId);
+        return $computeResource;
+
     }
-    else
+
+    /*
+     * Getting data for Compute resource inputs
+    */
+
+    public static function getEditCRData()
     {
-        /*
-        $fileSystems = new FileSystems();
-        foreach( $fileSystems as $fileSystem)
-            $computeDescription["fileSystems"][$fileSystem] = "";
-        */
-        $cd = new ComputeResourceDescription( $computeDescription);
-        $computeResourceId = Airavata::registerComputeResource( $cd);
+        $files = new FileSystems();
+        $jsp = new JobSubmissionProtocol();
+        $rjmt = new ResourceJobManagerType();
+        $sp = new SecurityProtocol();
+        $dmp = new DataMovementProtocol();
+        $jmc = new JobManagerCommand();
+        $mm = new MonitorMode();
+        return array(
+            "fileSystemsObject" => $files,
+            "fileSystems" => $files::$__names,
+            "jobSubmissionProtocolsObject" => $jsp,
+            "jobSubmissionProtocols" => $jsp::$__names,
+            "resourceJobManagerTypesObject" => $rjmt,
+            "resourceJobManagerTypes" => $rjmt::$__names,
+            "securityProtocolsObject" => $sp,
+            "securityProtocols" => $sp::$__names,
+            "dataMovementProtocolsObject" => $dmp,
+            "dataMovementProtocols" => $dmp::$__names,
+            "jobManagerCommands" => $jmc::$__names,
+            "monitorModes" => $mm::$__names
+        );
     }
 
-    $computeResource = Airavata::getComputeResource( $computeResourceId);
-    return $computeResource;
 
-}
+    public static function createQueueObject($queue)
+    {
+        $queueObject = new BatchQueue($queue);
+        return $queueObject;
+    }
 
-/*
- * Getting data for Compute resource inputs 
-*/
-
-public static function getEditCRData(){
-    $files = new FileSystems();
-    $jsp = new JobSubmissionProtocol();
-    $rjmt = new ResourceJobManagerType();
-    $sp = new SecurityProtocol();
-    $dmp = new DataMovementProtocol();
-    $jmc = new JobManagerCommand();
-    $mm = new MonitorMode();
-    return array(
-                    "fileSystemsObject" => $files,
-                    "fileSystems" => $files::$__names,
-                    "jobSubmissionProtocolsObject" => $jsp,
-                    "jobSubmissionProtocols" => $jsp::$__names,
-                    "resourceJobManagerTypesObject" => $rjmt,
-                    "resourceJobManagerTypes" => $rjmt::$__names,
-                    "securityProtocolsObject" => $sp,
-                    "securityProtocols" => $sp::$__names,
-                    "dataMovementProtocolsObject" => $dmp,
-                    "dataMovementProtocols" => $dmp::$__names,
-                    "jobManagerCommands" => $jmc::$__names,
-                    "monitorModes" => $mm::$__names
-                );
-}
+    public static function deleteQueue($computeResourceId, $queueName)
+    {
+        Airavata::deleteBatchQueue($computeResourceId, $queueName);
+    }
 
 
-public static function createQueueObject( $queue){
-    $queueObject = new BatchQueue( $queue); 
-    return $queueObject;
-}
+    /*
+     * Creating Job Submission Interface.
+    */
 
-public static function deleteQueue( $computeResourceId, $queueName)
-{
-    Airavata::deleteBatchQueue( $computeResourceId, $queueName);
-}
+    public static function create_or_update_JSIObject($inputs, $update = false)
+    {
 
+        $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
 
-/*
- * Creating Job Submission Interface.
-*/
 
-public static function create_or_update_JSIObject( $inputs, $update = false){
+        $jsiId = null;
+        if (isset($inputs["jsiId"]))
+            $jsiId = $inputs["jsiId"];
 
-    $computeResource = Utilities::get_compute_resource(  $inputs["crId"]);
+        if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::LOCAL) {
 
+            //print_r( $jsiObject->resourceJobManager->resourceJobManagerId);
+            $resourceManager = new ResourceJobManager(array(
+                "resourceJobManagerType" => $inputs["resourceJobManagerType"],
+                "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
+                "jobManagerBinPath" => $inputs["jobManagerBinPath"],
+                "jobManagerCommands" => $inputs["jobManagerCommands"]
+            ));
 
-    $jsiId = null;
-    if( isset( $inputs["jsiId"]))
-        $jsiId = $inputs["jsiId"];
+            //$rmId = $jsiObject->resourceJobManager->resourceJobManagerId;
+            //$rm = $airavataclient->updateResourceJobManager($rmId, $resourceManager);
+            //print_r( $rm); exit;
+            $localJobSubmission = new LOCALSubmission(array(
+                    "resourceJobManager" => $resourceManager
+                )
+            );
 
-    if( $inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::LOCAL)
-    {
+            if ($update) //update Local JSP
+            {
+                $jsiObject = Airavata::getLocalJobSubmission($jsiId);
+                $localSub = Airavata::updateResourceJobManager($jsiObject->resourceJobManager->resourceJobManagerId, $resourceManager);
+                //$localSub = $airavataclient->updateLocalSubmissionDetails( $jsiId, $localJobSubmission);
+            } else // create Local JSP
+            {
+                $localSub = Airavata::addLocalSubmissionDetails($computeResource->computeResourceId, 0, $localJobSubmission);
+                return $localSub;
+            }
 
-        //print_r( $jsiObject->resourceJobManager->resourceJobManagerId);
-        $resourceManager = new ResourceJobManager(array( 
-                                                    "resourceJobManagerType" => $inputs["resourceJobManagerType"],
-                                                    "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
-                                                    "jobManagerBinPath"      => $inputs["jobManagerBinPath"],
-                                                    "jobManagerCommands"     => $inputs["jobManagerCommands"]
-                                                    ));
-
-        //$rmId = $jsiObject->resourceJobManager->resourceJobManagerId;
-        //$rm = $airavataclient->updateResourceJobManager($rmId, $resourceManager);
-        //print_r( $rm); exit;
-        $localJobSubmission = new LOCALSubmission(  array(
-                                                            "resourceJobManager" => $resourceManager
-                                                        )
-                                                    );
-
-        if( $update) //update Local JSP
-        {
-            $jsiObject = Airavata::getLocalJobSubmission( $jsiId);
-            $localSub = Airavata::updateResourceJobManager(  $jsiObject->resourceJobManager->resourceJobManagerId, $resourceManager);
-            //$localSub = $airavataclient->updateLocalSubmissionDetails( $jsiId, $localJobSubmission);
-        }
-        else        // create Local JSP
-        {
-            $localSub = Airavata::addLocalSubmissionDetails( $computeResource->computeResourceId, 0, $localJobSubmission);
-            return $localSub;
+        } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::SSH) /* SSH */ {
+            $resourceManager = new ResourceJobManager(array(
+                "resourceJobManagerType" => $inputs["resourceJobManagerType"],
+                "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
+                "jobManagerBinPath" => $inputs["jobManagerBinPath"],
+                "jobManagerCommands" => $inputs["jobManagerCommands"]
+            ));
+            $sshJobSubmission = new SSHJobSubmission(array
+                (
+                    "securityProtocol" => intval($inputs["securityProtocol"]),
+                    "resourceJobManager" => $resourceManager,
+                    "alternativeSSHHostName" => $inputs["alternativeSSHHostName"],
+                    "sshPort" => intval($inputs["sshPort"]),
+                    "monitorMode" => intval($inputs["monitorMode"])
+                )
+            );
+            //var_dump( $sshJobSubmission); exit;
+            if ($update) //update Local JSP
+            {
+                $jsiObject = Airavata::getSSHJobSubmission($jsiId);
+
+                //first update resource job manager
+                $rmjId = $jsiObject->resourceJobManager->resourceJobManagerId;
+                Airavata::updateResourceJobManager($rmjId, $resourceManager);
+                $jsiObject = Airavata::getSSHJobSubmission($jsiId);
+
+                $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
+                $jsiObject->alternativeSSHHostName = $inputs["alternativeSSHHostName"];
+                $jsiObject->sshPort = intval($inputs["sshPort"]);
+                $jsiObject->monitorMode = intval($inputs["monitorMode"]);
+                $jsiObject->resourceJobManager = Airavata::getresourceJobManager($rmjId);
+                //var_dump( $jsiObject); exit;
+                //add updated resource job manager to ssh job submission object.
+                //$sshJobSubmission->resourceJobManager->resourceJobManagerId = $rmjId;
+                $localSub = Airavata::updateSSHJobSubmissionDetails($jsiId, $jsiObject);
+            } else {
+                $sshSub = Airavata::addSSHJobSubmissionDetails($computeResource->computeResourceId, 0, $sshJobSubmission);
+            }
+            return;
+        } else if ($inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::UNICORE) {
+            $unicoreJobSubmission = new UnicoreJobSubmission(array
+                (
+                    "securityProtocol" => intval($inputs["securityProtocol"]),
+                    "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
+                )
+            );
+            if ($update) {
+                $jsiObject = Airavata::getUnicoreJobSubmission($jsiId);
+                $jsiObject->securityProtocol = intval($inputs["securityProtocol"]);
+                $jsiObject->unicoreEndPointURL = $inputs["unicoreEndPointURL"];
+
+                $unicoreSub = Airavata::updateUnicoreJobSubmissionDetails($jsiId, $jsiObject);
+            } else {
+                $unicoreSub = Airavata::addUNICOREJobSubmissionDetails($computeResource->computeResourceId, 0, $unicoreJobSubmission);
+            }
+        } else /* Globus does not work currently */ {
+            print_r("Whoops! We haven't coded for this Job Submission Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
         }
-        
     }
-    else if( $inputs["jobSubmissionProtocol"] ==  JobSubmissionProtocol::SSH) /* SSH */
+
+    /*
+     * Creating Data Movement Interface Object.
+    */
+    public static function create_or_update_DMIObject($inputs, $update = false)
     {
-        $resourceManager = new ResourceJobManager(array( 
-                                                    "resourceJobManagerType" => $inputs["resourceJobManagerType"],
-                                                    "pushMonitoringEndpoint" => $inputs["pushMonitoringEndpoint"],
-                                                    "jobManagerBinPath"      => $inputs["jobManagerBinPath"],
-                                                    "jobManagerCommands"     => $inputs["jobManagerCommands"]
-                                                    ));
-        $sshJobSubmission = new SSHJobSubmission( array
-                                                    (
-                                                        "securityProtocol" => intval( $inputs["securityProtocol"]),
-                                                        "resourceJobManager" => $resourceManager,
-                                                        "alternativeSSHHostName" => $inputs["alternativeSSHHostName"],
-                                                        "sshPort" => intval( $inputs["sshPort"] ),
-                                                        "monitorMode" => intval( $inputs["monitorMode"] )
-                                                    )
-                                                );
-        //var_dump( $sshJobSubmission); exit;
-        if( $update) //update Local JSP
-        {
-            $jsiObject = Airavata::getSSHJobSubmission( $jsiId);
-
-            //first update resource job manager
-            $rmjId = $jsiObject->resourceJobManager->resourceJobManagerId;
-            Airavata::updateResourceJobManager(  $rmjId, $resourceManager);
-            $jsiObject = Airavata::getSSHJobSubmission( $jsiId);
-
-            $jsiObject->securityProtocol = intval( $inputs["securityProtocol"] );
-            $jsiObject->alternativeSSHHostName = $inputs["alternativeSSHHostName"];
-            $jsiObject->sshPort = intval( $inputs["sshPort"] );
-            $jsiObject->monitorMode = intval( $inputs["monitorMode"] );
-            $jsiObject->resourceJobManager = Airavata::getresourceJobManager( $rmjId);
-            //var_dump( $jsiObject); exit;
-            //add updated resource job manager to ssh job submission object.
-            //$sshJobSubmission->resourceJobManager->resourceJobManagerId = $rmjId;
-            $localSub = Airavata::updateSSHJobSubmissionDetails( $jsiId, $jsiObject);
-        }
-        else
-        {
-            $sshSub = Airavata::addSSHJobSubmissionDetails( $computeResource->computeResourceId, 0, $sshJobSubmission);
+
+        $computeResource = CRUtilities::get_compute_resource($inputs["crId"]);
+        if ($inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) /* LOCAL */ {
+            $localDataMovement = new LOCALDataMovement();
+            $localdmp = Airavata::addLocalDataMovementDetails($computeResource->computeResourceId, 0, $localDataMovement);
+
+            if ($localdmp)
+                print_r("The Local Data Movement has been added. Edit UI for the Local Data Movement Interface is yet to be made.
+                Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
+        } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) /* SCP */ {
+            //var_dump( $inputs); exit;
+            $scpDataMovement = new SCPDataMovement(array(
+                    "securityProtocol" => intval($inputs["securityProtocol"]),
+                    "alternativeSCPHostName" => $inputs["alternativeSSHHostName"],
+                    "sshPort" => intval($inputs["sshPort"])
+                )
+
+            );
+
+            if ($update)
+                $scpdmp = Airavata::updateSCPDataMovementDetails($inputs["dmiId"], $scpDataMovement);
+            else
+                $scpdmp = Airavata::addSCPDataMovementDetails($computeResource->computeResourceId, 0, $scpDataMovement);
+        } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) /* GridFTP */ {
+            $gridFTPDataMovement = new GridFTPDataMovement(array(
+                "securityProtocol" => $inputs["securityProtocol"],
+                "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]
+            ));
+            if ($update)
+                $gridftpdmp = Airavata::updateGridFTPDataMovementDetails($inputs["dmiId"], $gridFTPDataMovement);
+            else
+                $gridftpdmp = Airavata::addGridFTPDataMovementDetails($computeResource->computeResourceId, 0, $gridFTPDataMovement);
+        } else if ($inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) /* Unicore Storage Service */ {
+            $unicoreDataMovement = new UnicoreDataMovement(array
+                (
+                    "securityProtocol" => intval($inputs["securityProtocol"]),
+                    "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
+                )
+            );
+            if ($update)
+                $unicoredmp = Airavata::updateUnicoreDataMovementDetails($inputs["dmiId"], $unicoreDataMovement);
+            else
+                $unicoredmp = Airavata::addUnicoreDataMovementDetails($computeResource->computeResourceId, 0, $unicoreDataMovement);
+        } else /* other data movement protocols */ {
+            print_r("Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
         }
-        return;        
     }
-    else if( $inputs["jobSubmissionProtocol"] == JobSubmissionProtocol::UNICORE)
+
+    public static function getAllCRObjects($onlyName = false)
     {
-        $unicoreJobSubmission  = new UnicoreJobSubmission( array
-                                                            (
-                                                                "securityProtocol" => intval( $inputs["securityProtocol"]),
-                                                                "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
-                                                            )
-                                                        );
-        if( $update)
-        {
-            $jsiObject = Airavata::getUnicoreJobSubmission( $jsiId);
-            $jsiObject->securityProtocol = intval( $inputs["securityProtocol"] );
-            $jsiObject->unicoreEndPointURL = $inputs["unicoreEndPointURL"];
-
-            $unicoreSub = Airavata::updateUnicoreJobSubmissionDetails( $jsiId, $jsiObject);
-        }
-        else
-        {
-            $unicoreSub = Airavata::addUNICOREJobSubmissionDetails( $computeResource->computeResourceId, 0, $unicoreJobSubmission);
+        $crNames = Airavata::getAllComputeResourceNames();
+        if ($onlyName)
+            return $crNames;
+        else {
+            $crObjects = array();
+            foreach ($crNames as $id => $crName) {
+                $crObjects[] = Airavata::getComputeResource($id);
+            }
+            return $crObjects;
         }
-    }
-    else /* Globus does not work currently */
-    {
-        print_r( "Whoops! We haven't coded for this Job Submission Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
-    }
-}
 
-/*
- * Creating Data Movement Interface Object.
-*/
-public static function create_or_update_DMIObject( $inputs, $update = false){
+    }
 
-    $computeResource = Utilities::get_compute_resource(  $inputs["crId"] );
-    if( $inputs["dataMovementProtocol"] == DataMovementProtocol::LOCAL) /* LOCAL */
+    public static function getBrowseCRData()
     {
-        $localDataMovement = new LOCALDataMovement();
-        $localdmp = Airavata::addLocalDataMovementDetails( $computeResource->computeResourceId, 0, $localDataMovement);
-        
-        if( $localdmp)
-            print_r( "The Local Data Movement has been added. Edit UI for the Local Data Movement Interface is yet to be made.
-                Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
+        $appDeployments = Airavata::getAllApplicationDeployments(Session::get("gateway_id"));
+
+        return array('crObjects' => CRUtilities::getAllCRObjects(true),
+            'appDeployments' => $appDeployments
+        );
     }
-    else if( $inputs["dataMovementProtocol"] == DataMovementProtocol::SCP) /* SCP */
-    {
-        //var_dump( $inputs); exit;
-        $scpDataMovement = new SCPDataMovement( array(
-                                                "securityProtocol" => intval( $inputs["securityProtocol"] ),
-                                                "alternativeSCPHostName" => $inputs["alternativeSSHHostName"],
-                                                "sshPort" => intval( $inputs["sshPort"] )
-                                                )
-
-                                            );
-
-        if( $update)
-            $scpdmp = Airavata::updateSCPDataMovementDetails( $inputs["dmiId"], $scpDataMovement);
-        else
-            $scpdmp = Airavata::addSCPDataMovementDetails( $computeResource->computeResourceId, 0, $scpDataMovement);
-   }
-    else if( $inputs["dataMovementProtocol"] == DataMovementProtocol::GridFTP) /* GridFTP */
+
+    public static function getJobSubmissionDetails($jobSubmissionInterfaceId, $jsp)
     {
-        $gridFTPDataMovement = new GridFTPDataMovement( array(
-                "securityProtocol" => $inputs["securityProtocol"],
-                "gridFTPEndPoints" => $inputs["gridFTPEndPoints"]
-            ));
-        if( $update)
-            $gridftpdmp = Airavata::updateGridFTPDataMovementDetails( $inputs["dmiId"], $gridFTPDataMovement);
-        else
-            $gridftpdmp = Airavata::addGridFTPDataMovementDetails( $computeResource->computeResourceId, 0, $gridFTPDataMovement);
+        //jsp = job submission protocol type
+        if ($jsp == JobSubmissionProtocol::LOCAL)
+            return Airavata::getLocalJobSubmission($jobSubmissionInterfaceId);
+        else if ($jsp == JobSubmissionProtocol::SSH)
+            return Airavata::getSSHJobSubmission($jobSubmissionInterfaceId);
+        else if ($jsp == JobSubmissionProtocol::UNICORE)
+            return Airavata::getUnicoreJobSubmission($jobSubmissionInterfaceId);
+        else if ($jsp == JobSubmissionProtocol::CLOUD)
+            return Airavata::getCloudJobSubmission($jobSubmissionInterfaceId);
+
+        //globus get function not present ??
     }
-    else if( $inputs["dataMovementProtocol"] == DataMovementProtocol::UNICORE_STORAGE_SERVICE) /* Unicore Storage Service */
+
+    public static function getDataMovementDetails($dataMovementInterfaceId, $dmi)
     {
-        $unicoreDataMovement  = new UnicoreDataMovement( array
-                                                            (
-                                                                "securityProtocol" => intval( $inputs["securityProtocol"]),
-                                                                "unicoreEndPointURL" => $inputs["unicoreEndPointURL"]
-                                                            )
-                                                        );
-        if( $update)
-            $unicoredmp = Airavata::updateUnicoreDataMovementDetails( $inputs["dmiId"], $unicoreDataMovement);
-        else
-            $unicoredmp = Airavata::addUnicoreDataMovementDetails( $computeResource->computeResourceId, 0, $unicoreDataMovement);
+        //jsp = job submission protocol type
+        if ($dmi == DataMovementProtocol::LOCAL)
+            return Airavata::getLocalDataMovement($dataMovementInterfaceId);
+        else if ($dmi == DataMovementProtocol::SCP)
+            return Airavata::getSCPDataMovement($dataMovementInterfaceId);
+        else if ($dmi == DataMovementProtocol::GridFTP)
+            return Airavata::getGridFTPDataMovement($dataMovementInterfaceId);
+        else if ($dmi == DataMovementProtocol::UNICORE_STORAGE_SERVICE)
+            return Airavata::getUnicoreDataMovement($dataMovementInterfaceId);
+        /*
+        else if( $dmi == JobSubmissionProtocol::CLOUD)
+            return $airavataclient->getCloudJobSubmission( $dataMovementInterfaceId);
+        */
+
+        //globus get function not present ??
     }
-    else /* other data movement protocols */
+
+    public static function deleteActions($inputs)
     {
-        print_r( "Whoops! We haven't coded for this Data Movement Protocol yet. Still working on it. Please click <a href='" . URL::to('/') . "/cr/edit'>here</a> to go back to edit page for compute resource.");
+        if (isset($inputs["jsiId"]))
+            if (Airavata::deleteJobSubmissionInterface($inputs["crId"], $inputs["jsiId"]))
+                return 1;
+            else
+                return 0;
+        else if (isset($inputs["dmiId"]))
+            if (Airavata::deleteDataMovementInterface($inputs["crId"], $inputs["dmiId"]))
+                return 1;
+            else
+                return 0;
+        elseif (isset($inputs["del-crId"]))
+            if (Airavata::deleteComputeResource($inputs["del-crId"]))
+                return 1;
+            else
+                return 0;
     }
-}
 
-public static function getAllCRObjects( $onlyName = false){
-    $crNames = Airavata::getAllComputeResourceNames();
-    if( $onlyName)
-        return $crNames;
-    else
+    public static function create_or_update_gateway_profile($inputs, $update = false)
     {
-        $crObjects = array();
-        foreach( $crNames as $id => $crName)
-        {
-            $crObjects[] = Airavata::getComputeResource( $id);
-        }
-        return $crObjects;
-    }
 
-}
+        $computeResourcePreferences = array();
+        if (isset($input["crPreferences"]))
+            $computeResourcePreferences = $input["crPreferences"];
+
+        $gatewayProfile = new GatewayResourceProfile(array(
+                "gatewayName" => $inputs["gatewayName"],
+                "gatewayDescription" => $inputs["gatewayDescription"],
+                "computeResourcePreferences" => $computeResourcePreferences
+            )
+        );
+
+        if ($update) {
+            $gatewayProfile = new GatewayResourceProfile(array(
+                    "gatewayName" => $inputs["gatewayName"],
+                    "gatewayDescription" => $inputs["gatewayDescription"]
+                )
+            );
+            $gatewayProfileId = Airavata::updateGatewayResourceProfile($inputs["edit-gpId"], $gatewayProfile);
+        } else
+            $gatewayProfileId = Airavata::registerGatewayResourceProfile($gatewayProfile);
+    }
 
-public static function getBrowseCRData(){
-	$appDeployments = Airavata::getAllApplicationDeployments( Session::get("gateway_id"));
+    public static function getAllGatewayProfilesData()
+    {
 
-    return array( 'crObjects' => CRUtilities::getAllCRObjects(true),
-    			  'appDeployments' => $appDeployments 
-    			);
-}
+        if (Session::has("scigap_admin"))
+            $gateways = Airavata::getAllGateways();
+        else {
+            $gateways[0] = Airavata::getGateway(Session::get("gateway_id"));
+        }
 
-public static function getJobSubmissionDetails( $jobSubmissionInterfaceId, $jsp){
-    //jsp = job submission protocol type
-    if( $jsp == JobSubmissionProtocol::LOCAL)
-        return Airavata::getLocalJobSubmission( $jobSubmissionInterfaceId);
-    else if( $jsp == JobSubmissionProtocol::SSH)
-        return Airavata::getSSHJobSubmission( $jobSubmissionInterfaceId);
-    else if( $jsp == JobSubmissionProtocol::UNICORE)
-        return Airavata::getUnicoreJobSubmission( $jobSubmissionInterfaceId);
-    else if( $jsp == JobSubmissionProtocol::CLOUD)
-        return Airavata::getCloudJobSubmission( $jobSubmissionInterfaceId);
-
-    //globus get function not present ??	
-}
+        $gatewayProfiles = Airavata::getAllGatewayComputeResources();
+        //$gatewayProfileIds = array("GatewayTest3_57726e98-313f-4e7c-87a5-18e69928afb5", "GatewayTest4_4fd9fb28-4ced-4149-bdbd-1f276077dad8");
+        foreach ($gateways as $key => $gw) {
+            $gateways[$key]->profile = array();
+            foreach ((array)$gatewayProfiles as $index => $gp) {
+
+                if ($gw->gatewayId == $gp->gatewayID) {
+                    foreach ((array)$gp->computeResourcePreferences as $i => $crp) {
+                        $gatewayProfiles[$index]->computeResourcePreferences[$i]->crDetails = Airavata::getComputeResource($crp->computeResourceId);
+                    }
+                    $gateways[$key]->profile = $gatewayProfiles[$index];
+                }
+            }
+        }
+        //var_dump( $gatewayProfiles[0]->computeResourcePreferences[0]->crDetails); exit;
 
-public static function getDataMovementDetails( $dataMovementInterfaceId, $dmi){
-    //jsp = job submission protocol type
-    if( $dmi == DataMovementProtocol::LOCAL)
-        return Airavata::getLocalDataMovement( $dataMovementInterfaceId);
-    else if( $dmi == DataMovementProtocol::SCP)
-        return Airavata::getSCPDataMovement( $dataMovementInterfaceId);
-    else if( $dmi == DataMovementProtocol::GridFTP)
-        return Airavata::getGridFTPDataMovement( $dataMovementInterfaceId);
-    else if( $dmi == DataMovementProtocol::UNICORE_STORAGE_SERVICE)
-        return Airavata::getUnicoreDataMovement( $dataMovementInterfaceId);
-    /*
-    else if( $dmi == JobSubmissionProtocol::CLOUD)
-        return $airavataclient->getCloudJobSubmission( $dataMovementInterfaceId);
-    */
+        return $gateways;
+    }
 
-    //globus get function not present ??
-}
+    public static function add_or_update_CRP($inputs)
+    {
+        $computeResourcePreferences = new computeResourcePreference($inputs);
 
-public static function deleteActions( $inputs){
-    if( isset( $inputs["jsiId"]) )
-        if( Airavata::deleteJobSubmissionInterface( $inputs["crId"], $inputs["jsiId"]) )
-            return 1;
-        else
-            return 0;
-    else if( isset( $inputs["dmiId"]) )
-        if( Airavata::deleteDataMovementInterface( $inputs["crId"], $inputs["dmiId"]) )
-            return 1;
-        else 
-            return 0;
-    elseif( isset( $inputs["del-crId"]))
-    	if( Airavata::deleteComputeResource( $inputs["del-crId"] ) )
-    		return 1;
-    	else
-    		return 0;
-}
+        //var_dump( $inputs); exit;
+        return Airavata::addGatewayComputeResourcePreference($inputs["gatewayId"], $inputs["computeResourceId"], $computeResourcePreferences);
 
-public static function create_or_update_gateway_profile( $inputs, $update = false){
-
-    $computeResourcePreferences = array();
-    if( isset( $input["crPreferences"]) )
-        $computeResourcePreferences = $input["crPreferences"];
-
-    $gatewayProfile = new GatewayResourceProfile( array(
-                                                        "gatewayName" => $inputs["gatewayName"],
-                                                        "gatewayDescription" => $inputs["gatewayDescription"],
-                                                        "computeResourcePreferences" =>  $computeResourcePreferences
-                                                        )
-                                                );
-
-    if( $update){
-        $gatewayProfile = new GatewayResourceProfile( array(
-                                                        "gatewayName" => $inputs["gatewayName"],
-                                                        "gatewayDescription" => $inputs["gatewayDescription"]
-                                                        )
-                                                );
-        $gatewayProfileId = Airavata::updateGatewayResourceProfile( $inputs["edit-gpId"], $gatewayProfile);
     }
-    else
-        $gatewayProfileId = Airavata::registerGatewayResourceProfile( $gatewayProfile);
-}
 
-public static function getAllGatewayProfilesData(){
-
-    if( Session::has("scigap_admin") )
-        $gateways = Airavata::getAllGateways();
-    else
+    public static function deleteGP($gpId)
     {
-        $gateways[0] = Airavata::getGateway( Session::get("gateway_id") );
+        return Airavata::deleteGatewayResourceProfile($gpId);
     }
 
-    $gatewayProfiles = Airavata::getAllGatewayComputeResources();
-    //$gatewayProfileIds = array("GatewayTest3_57726e98-313f-4e7c-87a5-18e69928afb5", "GatewayTest4_4fd9fb28-4ced-4149-bdbd-1f276077dad8");
-    foreach( $gateways as $key => $gw)
+    public static function deleteCR($inputs)
     {
-        $gateways[$key]->profile = array();
-        foreach( (array)$gatewayProfiles as $index => $gp)
-        {
+        return Airavata::deleteGatewayComputeResourcePreference($inputs["gpId"], $inputs["rem-crId"]);
+    }
 
-            if( $gw->gatewayId == $gp->gatewayID)
-            {
-                foreach( (array)$gp->computeResourcePreferences as $i => $crp)
-                {
-                    $gatewayProfiles[$index]->computeResourcePreferences[$i]->crDetails = Airavata::getComputeResource( $crp->computeResourceId);
-                }
-                $gateways[$key]->profile = $gatewayProfiles[$index];
-            }
+    /**
+     * Get the ComputeResourceDescription with the given ID
+     * @param $id
+     * @return null
+     */
+    public static function get_compute_resource($id)
+    {
+        $computeResource = null;
+
+        try {
+            $computeResource = Airavata::getComputeResource($id);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the compute resource.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the compute resource.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting the compute resource.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
         }
+
+        return $computeResource;
     }
-    //var_dump( $gatewayProfiles[0]->computeResourcePreferences[0]->crDetails); exit;
-    
-    return $gateways;
-}
 
-public static function add_or_update_CRP( $inputs){
-    $computeResourcePreferences = new computeResourcePreference( $inputs);
 
-    //var_dump( $inputs); exit;
-    return Airavata::addGatewayComputeResourcePreference( $inputs["gatewayId"], $inputs["computeResourceId"], $computeResourcePreferences);
+    /**
+     * Create a select input and populate it with compute resources
+     * available for the given application ID
+     * @param $applicationId
+     * @param $resourceHostId
+     */
+    public static function create_compute_resources_select($applicationId, $resourceHostId)
+    {
+        return CRUtilities::get_available_app_interface_compute_resources($applicationId);
+    }
 
-}
+    /**
+     * Get a list of compute resources available for the given application ID
+     * @param $id
+     * @return null
+     */
+    public static function get_available_app_interface_compute_resources($id)
+    {
+        $computeResources = null;
+
+        try {
+            $computeResources = Airavata::getAvailableAppInterfaceComputeResources($id);
+        } catch (InvalidRequestException $ire) {
+            CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
+        } catch (AiravataClientException $ace) {
+            CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
+        } catch (AiravataSystemException $ase) {
+            CommonUtilities::print_error_message('<p>There was a problem getting compute resources.
+            Please try again later or submit a bug report using the link in the Help menu.</p>' .
+                '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
+        }
 
-public static function deleteGP( $gpId){
-    return Airavata::deleteGatewayResourceProfile( $gpId);
-}
+        return $computeResources;
+    }
 
-public static function deleteCR( $inputs){
-    return Airavata::deleteGatewayComputeResourcePreference( $inputs["gpId"], $inputs["rem-crId"]);
 }
 
-}
 ?>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/CommonUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/CommonUtilities.php b/app/libraries/CommonUtilities.php
new file mode 100644
index 0000000..7b7ee09
--- /dev/null
+++ b/app/libraries/CommonUtilities.php
@@ -0,0 +1,246 @@
+<?php
+
+class CommonUtilities
+{
+
+    /**
+     * Print success message
+     * @param $message
+     */
+    public static function print_success_message($message)
+    {
+        echo '<div class="alert alert-success">' . $message . '</div>';
+    }
+
+    /**
+     * Print warning message
+     * @param $message
+     */
+    public static function print_warning_message($message)
+    {
+        echo '<div class="alert alert-warning">' . $message . '</div>';
+    }
+
+    /**
+     * Print error message
+     * @param $message
+     */
+    public static function print_error_message($message)
+    {
+        echo '<div class="alert alert-danger">' . $message . '</div>';
+    }
+
+    /**
+     * Print info message
+     * @param $message
+     */
+    public static function print_info_message($message)
+    {
+        echo '<div class="alert alert-info">' . $message . '</div>';
+    }
+
+    /**
+     * Redirect to the given url
+     * @param $url
+     */
+    public static function redirect($url)
+    {
+        echo '<meta http-equiv="Refresh" content="0; URL=' . $url . '">';
+    }
+
+    /**
+     * Return true if the form has been submitted
+     * @return bool
+     */
+    public static function form_submitted()
+    {
+        return isset($_POST['Submit']);
+    }
+
+    /**
+     * Store username in session variables
+     * @param $username
+     */
+    public static function store_id_in_session($username)
+    {
+        Session::put('username', $username);
+        Session::put('loggedin', true);
+    }
+
+    /**
+     * Return true if the username stored in the session
+     * @return bool
+     */
+    public static function id_in_session()
+    {
+        if (Session::has("username") && Session::has('loggedin'))
+            return true;
+        else
+            return false;
+    }
+
+    /**
+     * Verify if the user is already logged in. If not, redirect to the home page.
+     */
+    public static function verify_login()
+    {
+        if (CommonUtilities::id_in_session()) {
+            return true;
+        } else {
+            CommonUtilities::print_error_message('User is not logged in!');
+            return false;
+        }
+    }
+
+    /**
+     * Create navigation bar
+     * Used for all pages
+     */
+    public static function create_nav_bar()
+    {
+        $menus = array();
+        if (Session::has('loggedin')) {
+            $menus = array
+            (
+                'Project' => array
+                (
+                    array('label' => 'Create', 'url' => URL::to('/') . '/project/create', "nav-active" => "project"),
+                    array('label' => 'Search', 'url' => URL::to('/') . '/project/search', "nav-active" => "project"),
+                    array('label' => 'Browse', 'url' => URL::to('/') . '/project/browse', "nav-active" => "project")
+                ),
+                'Experiment' => array
+                (
+                    array('label' => 'Create', 'url' => URL::to('/') . '/experiment/create', "nav-active" => "experiment"),
+                    array('label' => 'Search', 'url' => URL::to('/') . '/experiment/search', "nav-active" => "experiment"),
+                    array('label' => 'Browse', 'url' => URL::to('/') . '/experiment/browse', "nav-active" => "experiment")
+                )
+            );
+
+            if (Session::has("admin")) {
+                $menus['Compute Resource'] = array
+                (
+                    array('label' => 'Register', 'url' => URL::to('/') . '/cr/create', "nav-active" => "compute-resource"),
+                    array('label' => 'Browse', 'url' => URL::to('/') . '/cr/browse', "nav-active" => "compute-resource")
+                );
+                $menus['App Catalog'] = array
+                (
+                    array('label' => 'Module', 'url' => URL::to('/') . '/app/module', "nav-active" => "app-catalog"),
+                    array('label' => 'Interface', 'url' => URL::to('/') . '/app/interface', "nav-active" => "app-catalog"),
+                    array('label' => 'Deployment', 'url' => URL::to('/') . '/app/deployment', "nav-active" => "app-catalog")
+                );
+            }
+
+            $menus['Help'] = array
+            (
+                array('label' => 'Report Issue', 'url' => '#', "nav-active", ""),
+                array('label' => 'Request Feature', 'url' => '#', "nav-active", "")
+            );
+        }
+
+        echo '<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
+            <div class="container-fluid">
+                <!-- Brand and toggle get grouped for better mobile display -->
+                <div class="navbar-header">
+                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
+                       <span class="sr-only">Toggle navigation</span>
+                       <span class="icon-bar"></span>
+                       <span class="icon-bar"></span>
+                       <span class="icon-bar"></span>
+                    </button>
+                    <a class="navbar-brand" href="' . URL::to('home') . '" title="PHP Gateway with Airavata">PGA</a>
+                </div>
+
+                <!-- Collect the nav links, forms, and other content for toggling -->
+                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
+                    <ul class="nav navbar-nav">';
+
+
+        foreach ($menus as $label => $options) {
+            Session::has('loggedin') ? $disabled = '' : $disabled = ' class="disabled"';
+
+            $active = "";
+            if (Session::has("nav-active") && isset($options[0]['nav-active'])) {
+                if ($options[0]['nav-active'] == Session::get("nav-active"))
+                    $active = " active ";
+            }
+            echo '<li class="dropdown ' . $active . '">
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $label . '<span class="caret"></span></a>
+                <ul class="dropdown-menu" role="menu">';
+
+            if (Session::has('loggedin')) {
+                foreach ($options as $option) {
+                    $id = strtolower(str_replace(' ', '-', $option['label']));
+
+                    echo '<li' . $disabled . '><a href="' . $option['url'] . '" id=' . $id . '>' . $option['label'] . '</a></li>';
+                }
+            }
+
+            echo '</ul>
+        </li>';
+        }
+
+
+        echo '</ul>
+
+        <ul class="nav navbar-nav navbar-right">';
+
+        // right-aligned content
+
+        if (Session::has('loggedin')) {
+            $active = "";
+            if (Session::has("nav-active")) {
+                if ("user-console" == Session::get("nav-active"))
+                    $active = " active ";
+            }
+            if (Session::has("admin"))
+                echo '<li><a href="' . URL::to("/") . '/admin/dashboard"><span class="glyphicon glyphicon-user"></span> Dashboard</a></li>';
+            else
+                echo '<li><a href="' . URL::to("/") . '/user/profile"><span class="glyphicon glyphicon-user"></span> Profile</a></li>';
+
+            echo '<li class="dropdown ' . $active . '">
+
+                <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . Session::get("username") . ' <span class="caret"></span></a>';
+            echo '<ul class="dropdown-menu" role="menu">';
+
+            echo '<li><a href="' . URL::to('/') . '/logout"><span class="glyphicon glyphicon-log-out"></span> Log out</a></li>';
+            echo '</ul></li></ul>';
+        } else {
+            echo '<li><a href="' . URL::to('/') . '/create"><span class="glyphicon glyphicon-user"></span> Create account</a></li>';
+            echo '<li><a href="' . URL::to('/') . '/login"><span class="glyphicon glyphicon-log-in"></span> Log in</a></li>';
+            echo '</ul>';
+
+        }
+
+        echo '</div></div></nav>';
+    }
+
+    /**
+     * Add attributes to the HTTP header.
+     */
+    public static function create_http_header()
+    {
+        header('Cache-Control: no-store, no-cache, must-revalidate');
+        header('Cache-Control: post-check=0, pre-check=0', false);
+        header('Pragma: no-cache');
+    }
+
+    /**
+     * Open the XML file containing the community token
+     * @param $tokenFilePath
+     * @throws Exception
+     */
+    public static function open_tokens_file($tokenFilePath)
+    {
+        if (file_exists($tokenFilePath)) {
+            $tokenFile = simplexml_load_file($tokenFilePath);
+        } else {
+            throw new Exception('Error: Cannot connect to tokens database!');
+        }
+
+
+        if (!$tokenFile) {
+            throw new Exception('Error: Cannot open tokens database!');
+        }
+    }
+}
+


[02/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/experiment-queue-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-queue-block.blade.php b/app/views/partials/experiment-queue-block.blade.php
index a0453b0..d8d8476 100644
--- a/app/views/partials/experiment-queue-block.blade.php
+++ b/app/views/partials/experiment-queue-block.blade.php
@@ -1,113 +1,113 @@
 <input type="hidden" id="queue-array" value="{{ htmlentities( json_encode( $queues ) ) }}"/>
 <div class="form-group required">
-	@if( count( $queues) > 0 )
-	    <label class="control-label" for="node-count">Select a Queue</label>
-	    <select name="queue-name" class="form-control" id="select-queue" @if(isset($expVal) ) @if(!$expVal['editable']){{ disabled }} @endif @endif required>
-	    	<option value=""></option>
-	    @foreach( $queues as $queue)
-	    	<option value="{{$queue->queueName}}"
-	    			@if(isset($expVal) ) @if( $expVal['scheduling']->queueName == $queue->queueName ) selected @endif @endif
-	    			>
-	    			{{$queue->queueName}}
-	    	</option>
-	    @endforeach
-	   	</select>
-	@else
-		<div class="alert alert-warning">
-			This resources has no queues available at the moment. Please contact the administrator.
-		</div>
-	@endif
+    @if( count( $queues) > 0 )
+    <label class="control-label" for="node-count">Select a Queue</label>
+    <select name="queue-name" class="form-control" id="select-queue" @if(isset($expVal) ) @if(!$expVal['editable']){{
+    disabled }} @endif @endif required>
+    <option value=""></option>
+    @foreach( $queues as $queue)
+    <option value="{{$queue->queueName}}"
+    @if(isset($expVal) ) @if( $expVal['scheduling']->queueName == $queue->queueName ) selected @endif @endif
+    >
+    {{$queue->queueName}}
+    </option>
+    @endforeach
+    </select>
+    @else
+    <div class="alert alert-warning">
+        This resources has no queues available at the moment. Please contact the administrator.
+    </div>
+    @endif
 </div>
 
 <div class="queue-data @if(! isset($expVal) ) hide @endif">
-<div class="form-group">
-    <label for="node-count">Node Count <span>( Max Allowed Nodes - <span class="node-count alert-warning"></span>)</span></label>
-    <input type="number" class="form-control" name="node-count" id="node-count" min="1"
-    value="@if(isset($expVal) ){{ $expVal['scheduling']->nodeCount }}@else{{$queueDefaults['nodeCount']}}@endif"
-    @if(isset($expVal) ) @if(!$expVal['editable']){{disabled}} @endif @endif>
-</div>
-<div class="form-group">
-    <label for="cpu-count">Total Core Count <span>( Max Allowed Cores - <span class="cpu-count alert-warning"></span>)</span></label>
-    <input type="number" class="form-control" name="cpu-count" id="cpu-count" min="1"
-    value="@if(isset($expVal) ){{ $expVal['scheduling']->totalCPUCount }}@else{{$queueDefaults['cpuCount']}}@endif"
-    @if(isset($expVal)) @if(!$expVal['editable']){{disabled}} @endif @endif>
-</div>
-<div class="form-group">
-    <label for="wall-time">Wall Time Limit <span>( Max Allowed Wall Time - <span class="walltime-count alert-warning"></span>)</span></label>
-    <div class="input-group">
-        <input type="number" class="form-control" name="wall-time" id="wall-time" min="0"
-        value="@if(isset($expVal) ){{ $expVal['scheduling']->wallTimeLimit }}@else{{$queueDefaults['wallTimeLimit']}}@endif"
-        @if(isset($expVal)) @if(!$expVal['editable']){{disabled}} @endif @endif>
-        <span class="input-group-addon">minutes</span>
+    <div class="form-group">
+        <label for="node-count">Node Count <span>( Max Allowed Nodes - <span
+                    class="node-count alert-warning"></span>)</span></label>
+        <input type="number" class="form-control" name="node-count" id="node-count" min="1"
+               value="@if(isset($expVal) ){{ $expVal['scheduling']->nodeCount }}@else{{$queueDefaults['nodeCount']}}@endif"
+        @if(isset($expVal) ) @if(!$expVal['editable']){{disabled}} @endif @endif>
     </div>
-</div>
-<div class="form-group">
-    <label for="wall-time">Total Physical Memory <span>( Max Allowed Memory - <span class="memory-count alert-warning"></span>)</span></label>
-    <div class="input-group">
-        <input type="number" class="form-control" name="total-physical-memory" id="memory-count" min="0"
-        value="@if(isset($expVal) ){{ $expVal['scheduling']->totalPhysicalMemory }}@endif"
+    <div class="form-group">
+        <label for="cpu-count">Total Core Count <span>( Max Allowed Cores - <span
+                    class="cpu-count alert-warning"></span>)</span></label>
+        <input type="number" class="form-control" name="cpu-count" id="cpu-count" min="1"
+               value="@if(isset($expVal) ){{ $expVal['scheduling']->totalCPUCount }}@else{{$queueDefaults['cpuCount']}}@endif"
         @if(isset($expVal)) @if(!$expVal['editable']){{disabled}} @endif @endif>
-        <span class="input-group-addon">MB</span>
     </div>
-</div>
+    <div class="form-group">
+        <label for="wall-time">Wall Time Limit <span>( Max Allowed Wall Time - <span
+                    class="walltime-count alert-warning"></span>)</span></label>
+
+        <div class="input-group">
+            <input type="number" class="form-control" name="wall-time" id="wall-time" min="0"
+                   value="@if(isset($expVal) ){{ $expVal['scheduling']->wallTimeLimit }}@else{{$queueDefaults['wallTimeLimit']}}@endif"
+            @if(isset($expVal)) @if(!$expVal['editable']){{disabled}} @endif @endif>
+            <span class="input-group-addon">minutes</span>
+        </div>
+    </div>
+    <div class="form-group">
+        <label for="wall-time">Total Physical Memory <span>( Max Allowed Memory - <span
+                    class="memory-count alert-warning"></span>)</span></label>
+
+        <div class="input-group">
+            <input type="number" class="form-control" name="total-physical-memory" id="memory-count" min="0"
+                   value="@if(isset($expVal) ){{ $expVal['scheduling']->totalPhysicalMemory }}@endif"
+            @if(isset($expVal)) @if(!$expVal['editable']){{disabled}} @endif @endif>
+            <span class="input-group-addon">MB</span>
+        </div>
+    </div>
 </div>
 
 <script>
-$("#select-queue").change( function(){
-	var selectedQueue = $(this).val();
-	getQueueData( selectedQueue);
-});
+    $("#select-queue").change(function () {
+        var selectedQueue = $(this).val();
+        getQueueData(selectedQueue);
+    });
 
-function getQueueData( selectedQueue)
-{
-	var queues = $.parseJSON( $("#queue-array").val() );
-	console.log( queues);
-	for( var i =0; i< queues.length; i++)
-	{
-		if( queues[i]['queueName'] == selectedQueue)
-		{
-			//node-count
-			if( queues[i]['maxNodes'] != 0 && queues[i]['maxNodes'] != null )
-			{
-				$("#node-count").attr("max", queues[i]['maxNodes']).val(1);
-				$(".node-count").html( queues[i]['maxNodes']);
-				$(".node-count").parent().removeClass("hide");
-			}
-			else
-				$(".node-count").parent().addClass("hide");
+    function getQueueData(selectedQueue) {
+        var queues = $.parseJSON($("#queue-array").val());
+        console.log(queues);
+        for (var i = 0; i < queues.length; i++) {
+            if (queues[i]['queueName'] == selectedQueue) {
+                //node-count
+                if (queues[i]['maxNodes'] != 0 && queues[i]['maxNodes'] != null) {
+                    $("#node-count").attr("max", queues[i]['maxNodes']).val(1);
+                    $(".node-count").html(queues[i]['maxNodes']);
+                    $(".node-count").parent().removeClass("hide");
+                }
+                else
+                    $(".node-count").parent().addClass("hide");
 
 
-			//core-count
-			if( queues[i]['maxProcessors'] != 0 && queues[i]['maxProcessors'] != null )
-			{
-				$("#cpu-count").attr("max", queues[i]['maxProcessors']).val(1);
-				$(".cpu-count").html( queues[i]['maxProcessors']);
-				$(".cpu-count").parent().removeClass("hide");
-			}
-			else
-				$(".cpu-count").parent().addClass("hide");
+                //core-count
+                if (queues[i]['maxProcessors'] != 0 && queues[i]['maxProcessors'] != null) {
+                    $("#cpu-count").attr("max", queues[i]['maxProcessors']).val(1);
+                    $(".cpu-count").html(queues[i]['maxProcessors']);
+                    $(".cpu-count").parent().removeClass("hide");
+                }
+                else
+                    $(".cpu-count").parent().addClass("hide");
 
-			//walltime-count
-			if( queues[i]['maxRunTime'] != 0 && queues[i]['maxRunTime'] != null )
-			{
-				$("#wall-time").attr("max", queues[i]['maxRunTime']).val(0);
-				$(".walltime-count").html( queues[i]['maxRunTime']);
-				$(".walltime-count").parent().removeClass("hide");
-			}
-			else
-				$(".walltime-count").parent().addClass("hide");
+                //walltime-count
+                if (queues[i]['maxRunTime'] != 0 && queues[i]['maxRunTime'] != null) {
+                    $("#wall-time").attr("max", queues[i]['maxRunTime']).val(0);
+                    $(".walltime-count").html(queues[i]['maxRunTime']);
+                    $(".walltime-count").parent().removeClass("hide");
+                }
+                else
+                    $(".walltime-count").parent().addClass("hide");
 
-			//memory-count
-			if( queues[i]['maxMemory'] != 0 && queues[i]['maxMemory'] != null )
-			{
-				$("#memory-count").attr("max", queues[i]['maxMemory']).val(0);
-				$(".memory-count").html( queues[i]['maxMemory']);
-				$(".memory-count").parent().removeClass("hide");
-			}
-			else
-				$(".memory-count").parent().addClass("hide");
-		}
-	}
-	$(".queue-data").removeClass("hide");
-}
+                //memory-count
+                if (queues[i]['maxMemory'] != 0 && queues[i]['maxMemory'] != null) {
+                    $("#memory-count").attr("max", queues[i]['maxMemory']).val(0);
+                    $(".memory-count").html(queues[i]['maxMemory']);
+                    $(".memory-count").parent().removeClass("hide");
+                }
+                else
+                    $(".memory-count").parent().addClass("hide");
+            }
+        }
+        $(".queue-data").removeClass("hide");
+    }
 </script>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/gateway-preferences.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/gateway-preferences.blade.php b/app/views/partials/gateway-preferences.blade.php
index 51889d4..bb383f6 100644
--- a/app/views/partials/gateway-preferences.blade.php
+++ b/app/views/partials/gateway-preferences.blade.php
@@ -1,67 +1,88 @@
 <!-- String replace is done as Jquery creates problems when using period(.) in id or class. -->
-<div id="cr-{{ str_replace( '.', "_", $computeResource->computeResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
-	<h3 class="text-center">Set Preferences</h3>
-	<div class="form-group">
-		<label class="control-label col-md-3">Override by Airavata</label>
-		<div class="col-md-9">
-			<select class="form-control" name="overridebyAiravata">
-				<option value="1" @if( isset( $preferences) ) @if( 1 == $preferences->overridebyAiravata) selected @endif @endif>True</option>
-				<option value="0" @if( isset( $preferences) )  @if( 0 == $preferences->overridebyAiravata) selected @endif @endif>False</option>
-			</select>
-		</div>
-	</div><br/>
-	<div class="form-group">
-		<label class="control-label col-md-3">Login Username</label>
-		<div class="col-md-9">
-			<input type="text" name="loginUserName" class="form-control" value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif" />
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Preferred Job Submission Protocol</label>
-		<div class="col-md-9">
-			<select name="preferredJobSubmissionProtocol" class="form-control">
-			@foreach( (array)$computeResource->jobSubmissionInterfaces as $index => $jsi)
-				<option value="{{$jsi->jobSubmissionProtocol}}" @if( isset( $preferences) )  @if( $preferences->preferredJobSubmissionProtocol == $jsi->jobSubmissionProtocol) selected @endif @endif>{{ $crData["jobSubmissionProtocols"][$jsi->jobSubmissionProtocol] }}</option>
-			@endforeach
-			</select>
+<div id="cr-{{ str_replace( '.', "
+     _", $computeResource->computeResourceId) }}" class="@if(isset( $show) ) @if( !$show) hide @endif @else hide @endif">
+<h3 class="text-center">Set Preferences</h3>
+<div class="form-group">
+    <label class="control-label col-md-3">Override by Airavata</label>
 
-		</div>
-	</div>
-	<br/>
-	<div class="form-group">
-		<label class="control-label col-md-3">Preferred Data Movement Protocol</label>
-		<div class="col-md-9">
-			<select name="preferredDataMovementProtocol" class="form-control">
-			@foreach( (array)$computeResource->dataMovementInterfaces as $index => $dmi)
-				<option value="{{ $dmi->dataMovementProtocol}}"  @if( isset( $preferences) )  @if( $preferences->preferredDataMovementProtocol == $dmi->dataMovementProtocol) selected @endif @endif>{{ $crData["dataMovementProtocols"][$dmi->dataMovementProtocol] }}</option>
-			@endforeach
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Preferred Batch Queue</label>
-		<div class="col-md-9">
-			<select name="preferredBatchQueue" class="form-control">
-			@foreach( (array)$computeResource->batchQueues as $index => $queue)
-				<option value="{{ $queue->queueName}}"   @if( isset( $preferences) )  @if( $preferences->preferredBatchQueue == $queue->queueName) selected @endif @endif>{{ $queue->queueName}}</option>
-			@endforeach
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Scratch Location</label>
-		<div class="col-md-9">
-			<input type="text" name="scratchLocation" class="form-control" value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif" />
-		</div>
-	</div>
+    <div class="col-md-9">
+        <select class="form-control" name="overridebyAiravata">
+            <option value="1"
+            @if( isset( $preferences) ) @if( 1 == $preferences->overridebyAiravata) selected @endif @endif>True</option>
+            <option value="0"
+            @if( isset( $preferences) ) @if( 0 == $preferences->overridebyAiravata) selected @endif
+            @endif>False</option>
+        </select>
+    </div>
+</div><br/>
+<div class="form-group">
+    <label class="control-label col-md-3">Login Username</label>
 
-	<div class="form-group">
-		<label class="control-label col-md-3">Allocation Project Number</label>
-		<div class="col-md-9">
-			<input type="text" name="allocationProjectNumber" class="form-control" value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<input type="submit" class="form-control btn btn-primary" value="Set preferences" />
-	</div>
+    <div class="col-md-9">
+        <input type="text" name="loginUserName" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->loginUserName}}@endif"/>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Job Submission Protocol</label>
+
+    <div class="col-md-9">
+        <select name="preferredJobSubmissionProtocol" class="form-control">
+            @foreach( (array)$computeResource->jobSubmissionInterfaces as $index => $jsi)
+            <option value="{{$jsi->jobSubmissionProtocol}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredJobSubmissionProtocol ==
+            $jsi->jobSubmissionProtocol) selected @endif @endif>{{
+            $crData["jobSubmissionProtocols"][$jsi->jobSubmissionProtocol] }}</option>
+            @endforeach
+        </select>
+
+    </div>
+</div>
+<br/>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Data Movement Protocol</label>
+
+    <div class="col-md-9">
+        <select name="preferredDataMovementProtocol" class="form-control">
+            @foreach( (array)$computeResource->dataMovementInterfaces as $index => $dmi)
+            <option value="{{ $dmi->dataMovementProtocol}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredDataMovementProtocol == $dmi->dataMovementProtocol)
+            selected @endif @endif>{{ $crData["dataMovementProtocols"][$dmi->dataMovementProtocol] }}</option>
+            @endforeach
+        </select>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Preferred Batch Queue</label>
+
+    <div class="col-md-9">
+        <select name="preferredBatchQueue" class="form-control">
+            @foreach( (array)$computeResource->batchQueues as $index => $queue)
+            <option value="{{ $queue->queueName}}"
+            @if( isset( $preferences) ) @if( $preferences->preferredBatchQueue == $queue->queueName) selected @endif
+            @endif>{{ $queue->queueName}}</option>
+            @endforeach
+        </select>
+    </div>
+</div>
+<div class="form-group">
+    <label class="control-label col-md-3">Scratch Location</label>
+
+    <div class="col-md-9">
+        <input type="text" name="scratchLocation" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->scratchLocation}}@endif"/>
+    </div>
+</div>
+
+<div class="form-group">
+    <label class="control-label col-md-3">Allocation Project Number</label>
+
+    <div class="col-md-9">
+        <input type="text" name="allocationProjectNumber" class="form-control"
+               value="@if( isset( $preferences) ){{$preferences->allocationProjectNumber}}@endif"/>
+    </div>
+</div>
+<div class="form-group">
+    <input type="submit" class="form-control btn btn-primary" value="Set preferences"/>
+</div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/interface-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/interface-block.blade.php b/app/views/partials/interface-block.blade.php
index 3510bd3..fe28608 100644
--- a/app/views/partials/interface-block.blade.php
+++ b/app/views/partials/interface-block.blade.php
@@ -1,49 +1,54 @@
 @if( isset( $interfaceObject) )
-	<input type="hidden" name="app-interface-id" value="{{$interfaceObject->applicationInterfaceId}}"/>
+<input type="hidden" name="app-interface-id" value="{{$interfaceObject->applicationInterfaceId}}"/>
 @endif
 <div class="appInterfaceInputs">
-	<div class="form-group required">
-		<label class="control-label interface-name">Application Name</label>
-		<input type="text" readonly class="form-control" name="applicationName" required value="@if( isset( $interfaceObject) ){{$interfaceObject->applicationName}}@endif"/>
-	</div>
-	<div class="form-group">
-		<label class="control-label">Application Description</label>
-		<input type="text" readonly class="form-control" name="applicationDescription" value="@if( isset( $interfaceObject) ){{ $interfaceObject->applicationDescription}}@endif" />
-	</div>
-	<div class="form-group">
-		<label class="control-label">Application Modules</label>
-		<div class="app-modules">
-		@if( isset( $interfaceObject))
-		@for( $i=0; $i< count( $interfaceObject->applicationModules); $i++ )
-			<div class="input-group">
-				<select name="applicationModules[]" class="app-module-select form-control" readonly>
-				@foreach( $modules as $index => $module)
-					<option value="{{ $module->appModuleId }}" @if( $interfaceObject->applicationModules[$i] == $module->appModuleId) selected @endif>{{ $module->appModuleName}}</option>
-				@endforeach
-				</select>
-				<span class="input-group-addon hide remove-app-module" style="cursor:pointer;">x</span>
-			</div>
-		@endfor
-		@endif
-		</div>
-		<button type="button" class="hide btn btn-default add-app-module">Add Application Module</button>
-	</div>
-	<div class="form-group form-horizontal">
-		@if( isset( $interfaceObject))
-			@foreach( (array)$interfaceObject->applicationInputs as $index => $appInputs)
-				@include( 'partials/interface-input-block', array('dataTypes' => $dataTypes, 'appInputs' => $appInputs) )
-			@endforeach
-		@endif
-		<div class="app-inputs"></div>
-		<button type="button" class=" hide btn btn-default add-input">Add Application Input</button>
-	</div>
-	<div class="form-group form-horizontal">
-		@if( isset( $interfaceObject) )
-			@foreach( (array)$interfaceObject->applicationOutputs as $index => $appOutputs)
-				@include( 'partials/interface-output-block', array('dataTypes' => $dataTypes, 'appOutputs' => $appOutputs) )
-			@endforeach
-		@endif
-		<div class="app-outputs"></div>
-		<button type="button" class="hide btn btn-default add-output">Add Application Output</button>
-	</div>
+    <div class="form-group required">
+        <label class="control-label interface-name">Application Name</label>
+        <input type="text" readonly class="form-control" name="applicationName" required
+               value="@if( isset( $interfaceObject) ){{$interfaceObject->applicationName}}@endif"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Application Description</label>
+        <input type="text" readonly class="form-control" name="applicationDescription"
+               value="@if( isset( $interfaceObject) ){{ $interfaceObject->applicationDescription}}@endif"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Application Modules</label>
+
+        <div class="app-modules">
+            @if( isset( $interfaceObject))
+            @for( $i=0; $i< count( $interfaceObject->applicationModules); $i++ )
+            <div class="input-group">
+                <select name="applicationModules[]" class="app-module-select form-control" readonly>
+                    @foreach( $modules as $index => $module)
+                    <option value="{{ $module->appModuleId }}"
+                    @if( $interfaceObject->applicationModules[$i] == $module->appModuleId) selected @endif>{{
+                    $module->appModuleName}}</option>
+                    @endforeach
+                </select>
+                <span class="input-group-addon hide remove-app-module" style="cursor:pointer;">x</span>
+            </div>
+            @endfor
+            @endif
+        </div>
+        <button type="button" class="hide btn btn-default add-app-module">Add Application Module</button>
+    </div>
+    <div class="form-group form-horizontal">
+        @if( isset( $interfaceObject))
+        @foreach( (array)$interfaceObject->applicationInputs as $index => $appInputs)
+        @include( 'partials/interface-input-block', array('dataTypes' => $dataTypes, 'appInputs' => $appInputs) )
+        @endforeach
+        @endif
+        <div class="app-inputs"></div>
+        <button type="button" class=" hide btn btn-default add-input">Add Application Input</button>
+    </div>
+    <div class="form-group form-horizontal">
+        @if( isset( $interfaceObject) )
+        @foreach( (array)$interfaceObject->applicationOutputs as $index => $appOutputs)
+        @include( 'partials/interface-output-block', array('dataTypes' => $dataTypes, 'appOutputs' => $appOutputs) )
+        @endforeach
+        @endif
+        <div class="app-outputs"></div>
+        <button type="button" class="hide btn btn-default add-output">Add Application Output</button>
+    </div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/interface-input-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/interface-input-block.blade.php b/app/views/partials/interface-input-block.blade.php
index 60fde02..306e84b 100644
--- a/app/views/partials/interface-input-block.blade.php
+++ b/app/views/partials/interface-input-block.blade.php
@@ -1,95 +1,125 @@
 <div class="well app-input-data-block">
-	<span class="glyphicon glyphicon-trash pull-right remove-input-space"></span>
-	<h4>App Input Fields</h4>
-	<div class="form-group required">
-		<label class="control-label col-md-3">Name</label>
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="inputName[]" required value="@if( isset( $appInputs) ){{$appInputs->name}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Value</label>
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="inputValue[]" value="@if( isset( $appInputs)){{$appInputs->value}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Type</label>
-		<div class="col-md-9">
-			<select class="form-control" name="inputType[]" readonly>
-			@foreach( $dataTypes as $index => $dataType)
-				<option value="{{ $index }}" @if( isset( $appInputs) ) @if( $index == $appInputs->type) selected @endif @endif>{{ $dataType }}</option>
-			@endforeach
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Application Argument</label>
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="applicationArgumentInput[]" value="@if( isset( $appInputs) ){{$appInputs->applicationArgument }}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Standard Input</label>
-		<div class="col-md-9">
-			<select class="form-control" name="standardInput[]" readonly>
-				<option value="0" @if( isset( $appInputs) )  @if( 0 == $appInputs->standardInput) selected @endif @endif>False</option>
-				<option value="1" @if( isset( $appInputs) ) @if( 1 == $appInputs->standardInput) selected @endif @endif>True</option>
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">User Friendly Description</label>
-		<div class="col-md-9">
-			<textarea readonly class="form-control" name="userFriendlyDescription[]">@if( isset( $appInputs) ){{$appInputs->userFriendlyDescription}}@endif</textarea>
-		</div>
-	</div>
-	<div class="form-group col-md-6">
-		<label class="control-label col-md-5">Input Order</label>	
-		<div class="col-md-7">
-			<input type="number" readonly class="form-control" name="inputOrder[]" value="@if( isset( $appInputs) ){{$appInputs->inputOrder}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group col-md-7">
-		<label class="control-label col-md-4">Data is Staged?</label>
-		<div class="col-md-8">
-			<select name="dataStaged[]" class="form-control">
-				<option>select</option>
-				<option value="1" @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 1) selected @endif @endif>True</option>
-				<option value="0" @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 0) selected @endif @endif>False</option>
-			</select>
-		</div>
-		<!-- Removed Radio button because it creates problems with multiple inputs
-		<label class="radio-inline">
-			<input type="radio" name="dataStaged[]"  @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 1) checked @endif @endif>True
-		</label>
-		<label class="radio-inline">
-			<input type="radio" name="dataStaged[]"  @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 0) checked @endif @endif>False
-		</label>
-		-->
-	</div>
-	<div class="form-group col-md-6">
-		<label class="control-label col-md-6">Is the Input required?</label>
-		<div class="col-md-6">
-			<select class="form-control" name="isRequiredInput[]" readonly>
-				<option value="0" @if( isset( $appInputs) )  @if( 0 == $appInputs->isRequired) selected @endif @endif>False</option>
-				<option value="1" @if( isset( $appInputs) ) @if( 1 == $appInputs->isRequired) selected @endif @endif>True</option>
-			</select>
-		</div>
-	</div>
-	<div class="form-group col-md-7">
-		<label class="control-label col-md-6">Required on command line?</label>
-		<div class="col-md-6">
-			<select class="form-control" name="requiredToAddedToCommandLineInput[]" readonly>
-				<option value="0" @if( isset( $appInputs) )  @if( 0 == $appInputs->requiredToAddedToCommandLine) selected @endif @endif>False</option>
-				<option value="1" @if( isset( $appInputs) ) @if( 1 == $appInputs->requiredToAddedToCommandLine) selected @endif @endif>True</option>
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Meta Data</label>
-		<div class="col-md-9">
-			<textarea readonly class="form-control" name="metaData[]">@if( isset( $appInputs) ){{$appInputs->metaData}}@endif</textarea>
-		</div>
-	</div>
+    <span class="glyphicon glyphicon-trash pull-right remove-input-space"></span>
+    <h4>App Input Fields</h4>
+
+    <div class="form-group required">
+        <label class="control-label col-md-3">Name</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="inputName[]" required
+                   value="@if( isset( $appInputs) ){{$appInputs->name}}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Value</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="inputValue[]"
+                   value="@if( isset( $appInputs)){{$appInputs->value}}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Type</label>
+
+        <div class="col-md-9">
+            <select class="form-control" name="inputType[]" readonly>
+                @foreach( $dataTypes as $index => $dataType)
+                <option value="{{ $index }}"
+                @if( isset( $appInputs) ) @if( $index == $appInputs->type) selected @endif @endif>{{ $dataType
+                }}</option>
+                @endforeach
+            </select>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Application Argument</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="applicationArgumentInput[]"
+                   value="@if( isset( $appInputs) ){{$appInputs->applicationArgument }}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Standard Input</label>
+
+        <div class="col-md-9">
+            <select class="form-control" name="standardInput[]" readonly>
+                <option value="0"
+                @if( isset( $appInputs) ) @if( 0 == $appInputs->standardInput) selected @endif @endif>False</option>
+                <option value="1"
+                @if( isset( $appInputs) ) @if( 1 == $appInputs->standardInput) selected @endif @endif>True</option>
+            </select>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">User Friendly Description</label>
+
+        <div class="col-md-9">
+            <textarea readonly class="form-control" name="userFriendlyDescription[]">@if( isset( $appInputs)
+                ){{$appInputs->userFriendlyDescription}}@endif</textarea>
+        </div>
+    </div>
+    <div class="form-group col-md-6">
+        <label class="control-label col-md-5">Input Order</label>
+
+        <div class="col-md-7">
+            <input type="number" readonly class="form-control" name="inputOrder[]"
+                   value="@if( isset( $appInputs) ){{$appInputs->inputOrder}}@endif"/>
+        </div>
+    </div>
+    <div class="form-group col-md-7">
+        <label class="control-label col-md-4">Data is Staged?</label>
+
+        <div class="col-md-8">
+            <select name="dataStaged[]" class="form-control">
+                <option>select</option>
+                <option value="1"
+                @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 1) selected @endif @endif>True</option>
+                <option value="0"
+                @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 0) selected @endif @endif>False</option>
+            </select>
+        </div>
+        <!-- Removed Radio button because it creates problems with multiple inputs
+        <label class="radio-inline">
+            <input type="radio" name="dataStaged[]"  @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 1) checked @endif @endif>True
+        </label>
+        <label class="radio-inline">
+            <input type="radio" name="dataStaged[]"  @if( isset( $appInputs) ) @if( $appInputs->dataStaged == 0) checked @endif @endif>False
+        </label>
+        -->
+    </div>
+    <div class="form-group col-md-6">
+        <label class="control-label col-md-6">Is the Input required?</label>
+
+        <div class="col-md-6">
+            <select class="form-control" name="isRequiredInput[]" readonly>
+                <option value="0"
+                @if( isset( $appInputs) ) @if( 0 == $appInputs->isRequired) selected @endif @endif>False</option>
+                <option value="1"
+                @if( isset( $appInputs) ) @if( 1 == $appInputs->isRequired) selected @endif @endif>True</option>
+            </select>
+        </div>
+    </div>
+    <div class="form-group col-md-7">
+        <label class="control-label col-md-6">Required on command line?</label>
+
+        <div class="col-md-6">
+            <select class="form-control" name="requiredToAddedToCommandLineInput[]" readonly>
+                <option value="0"
+                @if( isset( $appInputs) ) @if( 0 == $appInputs->requiredToAddedToCommandLine) selected @endif
+                @endif>False</option>
+                <option value="1"
+                @if( isset( $appInputs) ) @if( 1 == $appInputs->requiredToAddedToCommandLine) selected @endif
+                @endif>True</option>
+            </select>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Meta Data</label>
+
+        <div class="col-md-9">
+            <textarea readonly class="form-control" name="metaData[]">@if( isset( $appInputs)
+                ){{$appInputs->metaData}}@endif</textarea>
+        </div>
+    </div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/interface-output-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/interface-output-block.blade.php b/app/views/partials/interface-output-block.blade.php
index fe78060..9ed1813 100644
--- a/app/views/partials/interface-output-block.blade.php
+++ b/app/views/partials/interface-output-block.blade.php
@@ -1,80 +1,105 @@
 <div class="well">
-	<span class="glyphicon glyphicon-trash pull-right remove-output-space"></span>
-	<h4>App Output Fields</h4>
-	<div class="form-group required">
-		<label class="control-label col-md-3">Name</label>
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="outputName[]" required value="@if( isset( $appOutputs) ){{$appOutputs->name}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Value</label>
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="outputValue[]" value="@if( isset( $appOutputs) ){{$appOutputs->value}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Type</label>
-		<div class="col-md-9">
-			<select class="form-control" name="outputType[]" readonly>
-			@foreach( $dataTypes as $index => $dataType)
-				<option value="{{ $index }}" @if( isset( $appOutputs) )  @if( $index == $appOutputs->type ) selected @endif @endif>{{ $dataType }}</option>
-			@endforeach
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Application Argument</label>
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="applicationArgumentOutput[]" value="@if( isset( $appOutputs) ){{$appOutputs->applicationArgument }}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Data Movement</label>
-		<div class="col-md-9">
-			<select name="dataMovement[]" class="form-control">
-				<option>select</option>
-				<option value="1" @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 1) selected @endif @endif>True</option>
-				<option value="0" @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 0) selected @endif @endif>False</option>
-			</select>
-		</div>
-		<!--
-		<label class="radio-inline">
-			<input type="radio" name="dataMovement[]"  @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 1) checked @endif @endif>True
-		</label>
-		<label class="radio-inline">
-			<input type="radio" name="dataMovement[]"  @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 0) checked @endif @endif>False
-		</label>
-		-->
-	</div>
-	<div class="form-group col-md-6">
-		<label class="control-label col-md-6">Is the Output required?</label>
-		<div class="col-md-6">
-			<select class="form-control" name="isRequiredOutput[]" readonly>
-				<option value="0" @if( isset( $appOutputs) )  @if( 0 == $appOutputs->isRequired) selected @endif @endif>False</option>
-				<option value="1" @if( isset( $appOutputs) ) @if( 1 == $appOutputs->isRequired) selected @endif @endif>True</option>
-			</select>
-		</div>
-	</div>
-	<div class="form-group col-md-7">
-		<label class="control-label col-md-6">Required on command line?</label>
-		<div class="col-md-6">
-			<select class="form-control" name="requiredToAddedToCommandLineOutput[]" readonly>
-				<option value="0" @if( isset( $appOutputs) )  @if( 0 == $appOutputs->requiredToAddedToCommandLine) selected @endif @endif>False</option>
-				<option value="1" @if( isset( $appOutputs) ) @if( 1 == $appOutputs->requiredToAddedToCommandLine) selected @endif @endif>True</option>
-			</select>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Location</label>	
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="location[]" value="@if( isset( $appOutputs) ){{$appOutputs->location}}@endif"/>
-		</div>
-	</div>
-	<div class="form-group">
-		<label class="control-label col-md-3">Search Query</label>	
-		<div class="col-md-9">
-			<input type="text" readonly class="form-control" name="searchQuery[]" value="@if( isset( $appOutputs) ){{$appOutputs->searchQuery}}@endif"/>
-		</div>
-	</div>
+    <span class="glyphicon glyphicon-trash pull-right remove-output-space"></span>
+    <h4>App Output Fields</h4>
+
+    <div class="form-group required">
+        <label class="control-label col-md-3">Name</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="outputName[]" required
+                   value="@if( isset( $appOutputs) ){{$appOutputs->name}}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Value</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="outputValue[]"
+                   value="@if( isset( $appOutputs) ){{$appOutputs->value}}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Type</label>
+
+        <div class="col-md-9">
+            <select class="form-control" name="outputType[]" readonly>
+                @foreach( $dataTypes as $index => $dataType)
+                <option value="{{ $index }}"
+                @if( isset( $appOutputs) ) @if( $index == $appOutputs->type ) selected @endif @endif>{{ $dataType
+                }}</option>
+                @endforeach
+            </select>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Application Argument</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="applicationArgumentOutput[]"
+                   value="@if( isset( $appOutputs) ){{$appOutputs->applicationArgument }}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Data Movement</label>
+
+        <div class="col-md-9">
+            <select name="dataMovement[]" class="form-control">
+                <option>select</option>
+                <option value="1"
+                @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 1) selected @endif @endif>True</option>
+                <option value="0"
+                @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 0) selected @endif @endif>False</option>
+            </select>
+        </div>
+        <!--
+        <label class="radio-inline">
+            <input type="radio" name="dataMovement[]"  @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 1) checked @endif @endif>True
+        </label>
+        <label class="radio-inline">
+            <input type="radio" name="dataMovement[]"  @if( isset( $appOutputs) ) @if( $appOutputs->dataMovement == 0) checked @endif @endif>False
+        </label>
+        -->
+    </div>
+    <div class="form-group col-md-6">
+        <label class="control-label col-md-6">Is the Output required?</label>
+
+        <div class="col-md-6">
+            <select class="form-control" name="isRequiredOutput[]" readonly>
+                <option value="0"
+                @if( isset( $appOutputs) ) @if( 0 == $appOutputs->isRequired) selected @endif @endif>False</option>
+                <option value="1"
+                @if( isset( $appOutputs) ) @if( 1 == $appOutputs->isRequired) selected @endif @endif>True</option>
+            </select>
+        </div>
+    </div>
+    <div class="form-group col-md-7">
+        <label class="control-label col-md-6">Required on command line?</label>
+
+        <div class="col-md-6">
+            <select class="form-control" name="requiredToAddedToCommandLineOutput[]" readonly>
+                <option value="0"
+                @if( isset( $appOutputs) ) @if( 0 == $appOutputs->requiredToAddedToCommandLine) selected @endif
+                @endif>False</option>
+                <option value="1"
+                @if( isset( $appOutputs) ) @if( 1 == $appOutputs->requiredToAddedToCommandLine) selected @endif
+                @endif>True</option>
+            </select>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Location</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="location[]"
+                   value="@if( isset( $appOutputs) ){{$appOutputs->location}}@endif"/>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-md-3">Search Query</label>
+
+        <div class="col-md-9">
+            <input type="text" readonly class="form-control" name="searchQuery[]"
+                   value="@if( isset( $appOutputs) ){{$appOutputs->searchQuery}}@endif"/>
+        </div>
+    </div>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/module-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/module-block.blade.php b/app/views/partials/module-block.blade.php
index b30ad27..c33b857 100644
--- a/app/views/partials/module-block.blade.php
+++ b/app/views/partials/module-block.blade.php
@@ -1,16 +1,16 @@
 <div id="new-app-module-block">
-	
-	<div class="form-group required">
-		<label class="control-label">Application Module Name</label>
-		<input type="text" class="form-control edit-name" name="appModuleName" maxlength="150" required/>
-	</div>
-	<div class="form-group">
-		<label class="control-label">Application Module Version</label>
-		<input type="text" class="form-control edit-version" name="appModuleVersion" maxlength="30" />
-	</div>
-	<div class="form-group">
-		<label class="control-label">Description</label>
-		<textarea class="form-control edit-desc" name="appModuleDescription" maxlength="255"></textarea>
-	</div>
-		
+
+    <div class="form-group required">
+        <label class="control-label">Application Module Name</label>
+        <input type="text" class="form-control edit-name" name="appModuleName" maxlength="150" required/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Application Module Version</label>
+        <input type="text" class="form-control edit-version" name="appModuleVersion" maxlength="30"/>
+    </div>
+    <div class="form-group">
+        <label class="control-label">Description</label>
+        <textarea class="form-control edit-desc" name="appModuleDescription" maxlength="255"></textarea>
+    </div>
+
 </div>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/partials/queue-block.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/queue-block.blade.php b/app/views/partials/queue-block.blade.php
index 0238b42..e805b1e 100644
--- a/app/views/partials/queue-block.blade.php
+++ b/app/views/partials/queue-block.blade.php
@@ -1,24 +1,35 @@
 <div class="form-group">
-	<label class="control-label">Queue Description</label>
-	<textarea class="form-control" maxlength="255" name="qdesc" placeholder="Queue Description">@if( isset( $queueData) ){{ $queueData->queueDescription }}@endif</textarea>
+    <label class="control-label">Queue Description</label>
+    <textarea class="form-control" maxlength="255" name="qdesc" placeholder="Queue Description">@if( isset( $queueData)
+        ){{ $queueData->queueDescription }}@endif</textarea>
 </div>
 <div class="form-group">
-	<label class="control-label">Queue Max Run Time<small> (In Minutes) </small></label>
-	<input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxRunTime }}@endif" maxlength="30" name="qmaxruntime" placeholder="Queue Max Run Time"/>
+    <label class="control-label">Queue Max Run Time
+        <small> (In Minutes)</small>
+    </label>
+    <input type="number" min="0" class="form-control"
+           value="@if( isset( $queueData) ){{ $queueData->maxRunTime }}@endif" maxlength="30" name="qmaxruntime"
+           placeholder="Queue Max Run Time"/>
 </div>
 <div class="form-group">
-	<label class="control-label">Queue Max Nodes</label>
-	<input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxNodes }}@endif" maxlength="30" name="qmaxnodes" placeholder="Queue Max Nodes"/>
+    <label class="control-label">Queue Max Nodes</label>
+    <input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxNodes }}@endif"
+           maxlength="30" name="qmaxnodes" placeholder="Queue Max Nodes"/>
 </div>
 <div class="form-group">
-	<label class="control-label">Queue Max Processors</label>
-	<input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxProcessors }}@endif" maxlength="30" name="qmaxprocessors" placeholder="Queue Max Processors"/>
+    <label class="control-label">Queue Max Processors</label>
+    <input type="number" min="0" class="form-control"
+           value="@if( isset( $queueData) ){{ $queueData->maxProcessors }}@endif" maxlength="30" name="qmaxprocessors"
+           placeholder="Queue Max Processors"/>
 </div>
 <div class="form-group">
-	<label class="control-label">Max Jobs in Queue</label>
-	<input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxJobsInQueue }}@endif" maxlength="30" name="qmaxjobsinqueue" placeholder="Max Jobs In Queue"/>
+    <label class="control-label">Max Jobs in Queue</label>
+    <input type="number" min="0" class="form-control"
+           value="@if( isset( $queueData) ){{ $queueData->maxJobsInQueue }}@endif" maxlength="30" name="qmaxjobsinqueue"
+           placeholder="Max Jobs In Queue"/>
 </div>
 <div class="form-group">
-	<label class="control-label">Max Memory For Queue( In MB )</label>
-	<input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxMemory }}@endif" maxlength="30" name="qmaxmemoryinqueue" placeholder="Max Memory For Queue"/>
+    <label class="control-label">Max Memory For Queue( In MB )</label>
+    <input type="number" min="0" class="form-control" value="@if( isset( $queueData) ){{ $queueData->maxMemory }}@endif"
+           maxlength="30" name="qmaxmemoryinqueue" placeholder="Max Memory For Queue"/>
 </div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/project/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/browse.blade.php b/app/views/project/browse.blade.php
index 674e654..5cbd293 100755
--- a/app/views/project/browse.blade.php
+++ b/app/views/project/browse.blade.php
@@ -1,106 +1,105 @@
-
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
-    <div class="container" style="max-width: 750px;">
-
-        <h1>Browse Projects</h1>
-        <?php
-
-        if (isset( $projects))
-        {
-        ?>
-
-        <!-- Pagination handling-->
-        <form id="paginationForm" action="{{URL::to('/')}}/project/browse" method="post" class="form-inline" role="form">
-            <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
-                <?php
-                if($pageNo!=1){
-                    echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
-                }
-                if(sizeof($projects)>0){
-                    echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
-                }
-                ?>
-            </div>
-            <div class="pull-left">
-                <?php if (sizeof($projects) != 0) echo 'Showing results from ' . strval(($pageNo-1)*$limit + 1)
-                    . ' to ' . strval(min($pageNo*$limit, ($pageNo-1)*$limit + sizeof($projects))); ?>
-            </div>
-            <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
-            <div style="clear: both"></div>
-        </form>
-
-        <?php
-            /**
-             * get results
-             */
-
-            /**
-             * display results
-             */
-            if (sizeof($projects) == 0)
-            {
-                Utilities::print_warning_message('No results found. Please try again.');
-            }
-            else
-            {
-            ?>
-                <div class="table-responsive">
-                    <table class="table">
+<div class="container" style="max-width: 750px;">
 
-                        <tr>
+    <h1>Browse Projects</h1>
+    <?php
 
-                            <th>Name</th>
-                            <th>Creation Time</th>
-                            <th>Experiments</th>
+    if (isset($projects))
+    {
+    ?>
 
-                        </tr>
+    <!-- Pagination handling-->
+    <form id="paginationForm" action="{{URL::to('/')}}/project/browse" method="post" class="form-inline" role="form">
+        <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
+            <?php
+            if ($pageNo != 1) {
+                echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
+            }
+            if (sizeof($projects) > 0) {
+                echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
+            }
+            ?>
+        </div>
+        <div class="pull-left">
+            <?php if (sizeof($projects) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
+                . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($projects))); ?>
+        </div>
+        <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
+
+        <div style="clear: both"></div>
+    </form>
+
+    <?php
+    /**
+     * get results
+     */
+
+    /**
+     * display results
+     */
+    if (sizeof($projects) == 0)
+    {
+        CommonUtilities::print_warning_message('No results found. Please try again.');
+    }
+    else
+    {
+    ?>
+    <div class="table-responsive">
+        <table class="table">
+
+            <tr>
+
+                <th>Name</th>
+                <th>Creation Time</th>
+                <th>Experiments</th>
+
+            </tr>
             <?php
 
-                foreach ($projects as $project)
-                {
+            foreach ($projects as $project) {
 
-            ?>
-                    <tr>
-                        <td>
-                            <?php echo $project->name; ?>
-                            <a href="{{URL::to('/')}}/project/edit?projId=<?php echo $project->projectID; ?>" title="Edit">
-                                <span class="glyphicon glyphicon-pencil"></span>
-                            </a>
-                        </td>
-                        <td class="time" unix-time="
-                            <?php echo $project->creationTime/1000 ?>">
-                        </td>
-                        <td>
-                            <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>">
-                                <span class="glyphicon glyphicon-list"></span>
-                            </a>
-                            <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>"> View</a>
-                        </td>
-                    </tr>
+                ?>
+                <tr>
+                    <td>
+                        <?php echo $project->name; ?>
+                        <a href="{{URL::to('/')}}/project/edit?projId=<?php echo $project->projectID; ?>" title="Edit">
+                            <span class="glyphicon glyphicon-pencil"></span>
+                        </a>
+                    </td>
+                    <td class="time" unix-time="
+                            <?php echo $project->creationTime / 1000 ?>">
+                    </td>
+                    <td>
+                        <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>">
+                            <span class="glyphicon glyphicon-list"></span>
+                        </a>
+                        <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>"> View</a>
+                    </td>
+                </tr>
             <?php
 
-                }
+            }
 
-                echo '</table>';
-                echo '</div>';
+            echo '</table>';
+            echo '</div>';
             }
 
-        }
-        
-        ?>
+            }
+
+            ?>
 
 
     </div>
 
-@stop
-@section('scripts')
-@parent
+    @stop
+    @section('scripts')
+    @parent
     {{ HTML::script('js/time-conversion.js')}}
-@stop
\ No newline at end of file
+    @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/project/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/create.blade.php b/app/views/project/create.blade.php
index 0cc28d3..46c04bc 100755
--- a/app/views/project/create.blade.php
+++ b/app/views/project/create.blade.php
@@ -1,42 +1,44 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="container" style="max-width: 750px">
-    
-<h1>Create a new project</h1>
 
+    <h1>Create a new project</h1>
 
-<form action="create" method="post" role="form" class="project-creation-form">
-    <div class="form-group required">
-        <label for="project-name" class="control-label">Project Name</label>
-        <input type="text" class="form-control projectName" name="project-name" id="project-name" placeholder="Enter project name" autofocus required>
-    </div>
 
-    <div class="form-group">
-        <label for="project-description">Project Description</label>
-        <textarea class="form-control" name="project-description" id="project-description" placeholder="Optional: Enter a short description of the project"></textarea>
-    </div>
+    <form action="create" method="post" role="form" class="project-creation-form">
+        <div class="form-group required">
+            <label for="project-name" class="control-label">Project Name</label>
+            <input type="text" class="form-control projectName" name="project-name" id="project-name"
+                   placeholder="Enter project name" autofocus required>
+        </div>
 
-    <input name="save" type="submit" class="btn btn-primary create-project" value="Save">
-    <input name="clear" type="reset" class="btn btn-default" value="Clear">
+        <div class="form-group">
+            <label for="project-description">Project Description</label>
+            <textarea class="form-control" name="project-description" id="project-description"
+                      placeholder="Optional: Enter a short description of the project"></textarea>
+        </div>
 
+        <input name="save" type="submit" class="btn btn-primary create-project" value="Save">
+        <input name="clear" type="reset" class="btn btn-default" value="Clear">
 
-</form>
+
+    </form>
 
 </div>
 
 @stop
 
 @section('scripts')
-    @parent
-    <script>
-        $(".projectName").blur( function(){
-            $(this).val( $.trim( $(this).val() ) );
-        });
-    </script>
+@parent
+<script>
+    $(".projectName").blur(function () {
+        $(this).val($.trim($(this).val()));
+    });
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/project/edit.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/edit.blade.php b/app/views/project/edit.blade.php
index e2c40b1..26e4df4 100755
--- a/app/views/project/edit.blade.php
+++ b/app/views/project/edit.blade.php
@@ -1,21 +1,21 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="container" style="max-width: 750px;">
 
-	<?php if( Session::has("project_edited")) { ?>
-		<div class="alert alert-success">
-			The project has been edited
-		</div>
-		<?php Session::forget("project_edited"); 
+    <?php if (Session::has("project_edited")) { ?>
+        <div class="alert alert-success">
+            The project has been edited
+        </div>
+        <?php Session::forget("project_edited");
 
-		}
-	?>
+    }
+    ?>
 
 
     <h1>Edit Project</h1>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/project/search.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/search.blade.php b/app/views/project/search.blade.php
index d4c7835..b7c400b 100755
--- a/app/views/project/search.blade.php
+++ b/app/views/project/search.blade.php
@@ -1,136 +1,136 @@
-
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
-    <div class="container" style="max-width: 750px;">
+<div class="container" style="max-width: 750px;">
 
-        <h1>Search for Projects</h1>
+    <h1>Search for Projects</h1>
 
-        <form action="{{ URL::to('/') }}/project/search" method="post" class="form-inline" role="form">
-            <div class="form-group">
-                <label for="search-key">Search by</label>
-                <select class="form-control" name="search-key" id="search-key">
-                    <option value="project-name">Project Name</option>
-                    <option value="project-description">Project description</option>
-                </select>
-            </div>
+    <form action="{{ URL::to('/') }}/project/search" method="post" class="form-inline" role="form">
+        <div class="form-group">
+            <label for="search-key">Search by</label>
+            <select class="form-control" name="search-key" id="search-key">
+                <option value="project-name">Project Name</option>
+                <option value="project-description">Project description</option>
+            </select>
+        </div>
 
-            <div class="form-group">
-                <label for="search-value">for</label>
-                <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
-                       value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
-            </div>
+        <div class="form-group">
+            <label for="search-value">for</label>
+            <input type="search" class="form-control" name="search-value" id="search-value" placeholder="value" required
+                   value="<?php if (isset($_POST['search-value'])) echo $_POST['search-value'] ?>">
+        </div>
 
-            <button name="search" type="submit" class="btn btn-primary" value="Search"><span class="glyphicon glyphicon-search"></span> Search</button>
-                <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your projects.</p>
+        <button name="search" type="submit" class="btn btn-primary" value="Search"><span
+                class="glyphicon glyphicon-search"></span> Search
+        </button>
+        <p class="help-block">You can use * as a wildcard character. Tip: search for * alone to retrieve all of your
+            projects.</p>
 
-            <!-- Pagination Handling -->
-            <?php
-            if(isset( $projects))
-            {
-                ?>
-                <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
-                    <?php
-                    if($pageNo!=1){
-                        echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
-                    }
-                    if(sizeof($projects)>0){
-                        echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
-                    }
-                    ?>
-                </div>
-                <div class="pull-left">
-                    <?php if (sizeof($projects) != 0) echo 'Showing results from ' . strval(($pageNo-1)*$limit + 1)
-                        . ' to ' . strval(min($pageNo*$limit, ($pageNo-1)*$limit + sizeof($projects))); ?>
-                </div>
-                <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
-                <div style="clear: both"></div>
-            <?php
-            }
+        <!-- Pagination Handling -->
+        <?php
+        if (isset($projects)) {
             ?>
-        </form>
+            <div class="pull-right btn-toolbar" style="padding-bottom: 5px">
+                <?php
+                if ($pageNo != 1) {
+                    echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="prev" value="Previous"/>';
+                }
+                if (sizeof($projects) > 0) {
+                    echo '<input class="btn btn-primary btn-xs" type="submit" style="cursor: pointer" name="next" value="Next"/>';
+                }
+                ?>
+            </div>
+            <div class="pull-left">
+                <?php if (sizeof($projects) != 0) echo 'Showing results from ' . strval(($pageNo - 1) * $limit + 1)
+                    . ' to ' . strval(min($pageNo * $limit, ($pageNo - 1) * $limit + sizeof($projects))); ?>
+            </div>
+            <input type="hidden" name="pageNo" value="<?php echo($pageNo) ?>"/>
+            <div style="clear: both"></div>
+        <?php
+        }
+        ?>
+    </form>
 
 
 
 
 
-        <?php
+    <?php
 
-        if (isset( $projects))
-        {
-            /**
-             * get results
-             */
-
-            /**
-             * display results
-             */
-            if (sizeof($projects) == 0)
-            {
-                if($pageNo==1){
-                    Utilities::print_warning_message('No results found. Please try again.');
-                }else{
-                    Utilities::print_warning_message('No more results found.');
-                }
-            }
-            else
-            {
-            ?>
-                <div class="table-responsive">
-                    <table class="table">
+    if (isset($projects))
+    {
+    /**
+     * get results
+     */
 
-                        <tr>
+    /**
+     * display results
+     */
+    if (sizeof($projects) == 0)
+    {
+        if ($pageNo == 1) {
+            CommonUtilities::print_warning_message('No results found. Please try again.');
+        } else {
+            CommonUtilities::print_warning_message('No more results found.');
+        }
+    }
+    else
+    {
+    ?>
+    <div class="table-responsive">
+        <table class="table">
 
-                            <th>Name</th>
-                            <th>Creation Time</th>
-                            <th>Experiments</th>
+            <tr>
 
-                        </tr>
+                <th>Name</th>
+                <th>Creation Time</th>
+                <th>Experiments</th>
+
+            </tr>
             <?php
 
-                foreach ($projects as $project)
-                {
+            foreach ($projects as $project) {
 
-            ?>
-                    <tr>
-                        <td>
-                            <?php echo $project->name; ?>
-                            <a href="{{URL::to('/')}}/project/edit?projId=<?php echo $project->projectID; ?>" title="Edit">
-                                <span class="glyphicon glyphicon-pencil"></span>
-                            </a>
-                        </td>
-                        <td class="time" unix-time="
-                            <?php echo $project->creationTime/1000 ?>">
-                        </td>
-                        <td>
-                            <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>">
-                                <span class="glyphicon glyphicon-list"></span>
-                            </a>
-                            <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>"> View</a>
-                        </td>
-                    </tr>
+                ?>
+                <tr>
+                    <td>
+                        <?php echo $project->name; ?>
+                        <a href="{{URL::to('/')}}/project/edit?projId=<?php echo $project->projectID; ?>" title="Edit">
+                            <span class="glyphicon glyphicon-pencil"></span>
+                        </a>
+                    </td>
+                    <td class="time" unix-time="
+                            <?php echo $project->creationTime / 1000 ?>">
+                    </td>
+                    <td>
+                        <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>">
+                            <span class="glyphicon glyphicon-list"></span>
+                        </a>
+                        <a href="{{URL::to('/')}}/project/summary?projId=<?php echo $project->projectID; ?>"> View</a>
+                    </td>
+                </tr>
             <?php
 
-                }
+            }
 
-                echo '</table>';
-                echo '</div>';
+            echo '</table>';
+            echo '</div>';
             }
 
-        }
-        
-        ?>
+            }
+
+            ?>
 
 
     </div>
 
-@stop
-@section('scripts')
-@parent
-   {{ HTML::script('js/time-conversion.js')}}
-@stop
\ No newline at end of file
+    @stop
+    @section('scripts')
+    @parent
+    {{ HTML::script('js/time-conversion.js')}}
+    @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/project/summary.blade.php
----------------------------------------------------------------------
diff --git a/app/views/project/summary.blade.php b/app/views/project/summary.blade.php
index f0b827c..d054384 100755
--- a/app/views/project/summary.blade.php
+++ b/app/views/project/summary.blade.php
@@ -1,7 +1,7 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
@@ -15,20 +15,19 @@
 
     <?php
 
-    $project = Utilities::get_project($_GET['projId']);
-
+    $project = ProjectUtilities::get_project($_GET['projId']);
 
 
     echo '<div class="panel panel-default">';
 
     echo '<div class="panel-heading">';
     echo '<h3>' . $project->name . ' <a href="edit?projId=' .
-                        $project->projectID .
-                        '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a></h3>';
+        $project->projectID .
+        '" title="Edit"><span class="glyphicon glyphicon-pencil"></span></a></h3>';
     echo "<p>$project->description</p>";
     echo '</div>';
 
-    $experiments = Utilities::get_experiments_in_project($project->projectID);
+    $experiments = ProjectUtilities::get_experiments_in_project($project->projectID);
 
     echo '<div class="table-responsive">';
     echo '<table class="table">';
@@ -43,18 +42,16 @@
 
     echo '</tr>';
 
-    foreach ($experiments as $experiment)
-    {
-    	$expValues = Utilities::get_experiment_values( $experiment, Utilities::get_project($experiment->projectID), true );
-        $applicationInterface = Utilities::get_application_interface($experiment->applicationId);
+    foreach ($experiments as $experiment) {
+        $expValues = ExperimentUtilities::get_experiment_values($experiment, ProjectUtilities::get_project($experiment->projectID), true);
+        $applicationInterface = AppUtilities::get_application_interface($experiment->applicationId);
 
         echo '<tr>';
 
         echo '<td>';
 
 
-        switch ($expValues["experimentStatusString"])
-        {
+        switch ($expValues["experimentStatusString"]) {
             case 'SCHEDULED':
             case 'LAUNCHED':
             case 'EXECUTING':
@@ -71,18 +68,16 @@
         }
 
 
-
         echo '</td>';
 
         echo "<td>$applicationInterface->applicationName</td>";
 
-        echo '<td>' . Utilities::get_compute_resource($experiment->userConfigurationData
+        echo '<td>' . CRUtilities::get_compute_resource($experiment->userConfigurationData
                 ->computationalResourceScheduling->resourceHostId)->hostName . '</td>';
         echo '<td class="time" unix-time="' . $expValues["experimentTimeOfStateChange"] . '"></td>';
 
 
-        switch ($expValues["experimentStatusString"])
-        {
+        switch ($expValues["experimentStatusString"]) {
             case 'CANCELING':
             case 'CANCELED':
             case 'UNKNOWN':
@@ -122,5 +117,5 @@
 @stop
 @section('scripts')
 @parent
-    {{ HTML::script('js/time-conversion.js')}}
+{{ HTML::script('js/time-conversion.js')}}
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/resource/browse.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/browse.blade.php b/app/views/resource/browse.blade.php
index 7580200..ac78bfa 100644
--- a/app/views/resource/browse.blade.php
+++ b/app/views/resource/browse.blade.php
@@ -1,135 +1,140 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="container">
-	@if( Session::has("message"))
-		<div class="col-md-12">
-			<span class="alert alert-success">{{ Session::get("message") }}</span>
-		</div>
-		{{ Session::forget("message") }}
-	@endif  
-
-	@if ( isset( $allCRs) )
-        @if (sizeof($allCRs) == 0)
-            {{ Utilities::print_warning_message('No Compute Resources are registered. Please use "Register Compute Resource" to register a new resources.') }}
-        @else
-            <div class="col-md-12">
-            <div class="row">
-                <div class="col-md-6">
-                    <h3 style="margin:0;">Existing Compute Resources :</h3>
-                </div>
-                <input type="text" class="pull-right filterinput col-md-6" placeholder="Search by Compute Resource Name"/>
+    @if( Session::has("message"))
+    <div class="col-md-12">
+        <span class="alert alert-success">{{ Session::get("message") }}</span>
+    </div>
+    {{ Session::forget("message") }}
+    @endif
+
+    @if ( isset( $allCRs) )
+    @if (sizeof($allCRs) == 0)
+    {{ Utilities::print_warning_message('No Compute Resources are registered. Please use "Register Compute Resource" to
+    register a new resources.') }}
+    @else
+    <div class="col-md-12">
+        <div class="row">
+            <div class="col-md-6">
+                <h3 style="margin:0;">Existing Compute Resources :</h3>
             </div>
-            <div class="row">
-                <div class="table-responsive">
-                    <table class="table">
-
-                        <tr>
-
-                            <th>Name</th>
-                            <th>Id</th>
-                            <th>Edit</th>
-                            <th>View</th>
-                            <th>Delete</th>
-                        </tr>
-
-                @foreach ($allCRs as $crId => $crName)
-
-    	                <tr id="crDetails">
-    	                    <td>{{ $crName }}</td>
-    	                    <td>{{ $crId }}</td>
-    	                    <td><a href="{{URL::to('/')}}/cr/edit?crId={{ $crId }}" title="Edit">
-    	                            <span class="glyphicon glyphicon-pencil"></span>
-    	                        </a>
-    	                    </td>
-    	                    <td>
-    	                        <a  class="view-cr" href="#" > <!-- {{URL::to('/')}}/cr/summary?crId={{ $crId }}"> -->
-    	                            <span class="glyphicon glyphicon-list"></span>
-    	                        </a>
-    	                    </td>
-    	                    <td>
-    	                    	<a href="#" title="Delete">
-    	                    		<span class="glyphicon glyphicon-trash del-cr"  data-toggle="modal" data-target="#delete-cr-block"  data-delete-cr-name="{{$crName}}" data-deployment-count="{{$connectedDeployments[$crId]}}" data-crid="{{$crId}}" ></span>
-    	                    	</a>
-    	                    </td>
-    	                </tr>
-    	            @endforeach
-
-    	           </table>
-    			</div>
+            <input type="text" class="pull-right filterinput col-md-6" placeholder="Search by Compute Resource Name"/>
+        </div>
+        <div class="row">
+            <div class="table-responsive">
+                <table class="table">
+
+                    <tr>
+
+                        <th>Name</th>
+                        <th>Id</th>
+                        <th>Edit</th>
+                        <th>View</th>
+                        <th>Delete</th>
+                    </tr>
+
+                    @foreach ($allCRs as $crId => $crName)
+
+                    <tr id="crDetails">
+                        <td>{{ $crName }}</td>
+                        <td>{{ $crId }}</td>
+                        <td><a href="{{URL::to('/')}}/cr/edit?crId={{ $crId }}" title="Edit">
+                                <span class="glyphicon glyphicon-pencil"></span>
+                            </a>
+                        </td>
+                        <td>
+                            <a class="view-cr" href="#"> <!-- {{URL::to('/')}}/cr/summary?crId={{ $crId }}"> -->
+                                <span class="glyphicon glyphicon-list"></span>
+                            </a>
+                        </td>
+                        <td>
+                            <a href="#" title="Delete">
+                                <span class="glyphicon glyphicon-trash del-cr" data-toggle="modal"
+                                      data-target="#delete-cr-block" data-delete-cr-name="{{$crName}}"
+                                      data-deployment-count="{{$connectedDeployments[$crId]}}"
+                                      data-crid="{{$crId}}"></span>
+                            </a>
+                        </td>
+                    </tr>
+                    @endforeach
+
+                </table>
             </div>
+        </div>
+        @endif
         @endif
-    @endif
 
-<div class="modal fade" id="delete-cr-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-    <div class="modal-dialog">
-
-		<form action="{{URL::to('/')}}/cr/delete-cr" method="POST">
-	        <div class="modal-content">
-	            <div class="modal-header">
-	              	<h3 class="text-center">Delete Compute Resource Confirmation</h3>
-	            </div>
-	            <div class="modal-body">
-					<input type="hidden" class="form-control delete-crId" name="del-crId"/>
-					The Compute Resource, <span class="delete-cr-name"></span> is connected to <span class="deploymentCount">0</span> deployments.
-			 		Do you really want to delete it? This action cannot be undone.
-				</div>
-				<div class="modal-footer">
-					<div class="form-group">
-						<input type="submit" class="btn btn-danger" value="Delete"/>
-						<input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-					</div>
-				</div>
-			</div>
-
-		</form>
-	</div>
-</div>
-
-</div>
+        <div class="modal fade" id="delete-cr-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+             aria-hidden="true">
+            <div class="modal-dialog">
+
+                <form action="{{URL::to('/')}}/cr/delete-cr" method="POST">
+                    <div class="modal-content">
+                        <div class="modal-header">
+                            <h3 class="text-center">Delete Compute Resource Confirmation</h3>
+                        </div>
+                        <div class="modal-body">
+                            <input type="hidden" class="form-control delete-crId" name="del-crId"/>
+                            The Compute Resource, <span class="delete-cr-name"></span> is connected to <span
+                                class="deploymentCount">0</span> deployments.
+                            Do you really want to delete it? This action cannot be undone.
+                        </div>
+                        <div class="modal-footer">
+                            <div class="form-group">
+                                <input type="submit" class="btn btn-danger" value="Delete"/>
+                                <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
+                            </div>
+                        </div>
+                    </div>
+
+                </form>
+            </div>
+        </div>
 
-@stop
-@section('scripts')
-	@parent
-	<script type="text/javascript">
-    $(".view-cr").click( function(){
-    	alert("The functionality to view a Compute Resource is under construction.");
-    });
-    $('.filterinput').keyup(function() {
-        var value = $(this).val();
-        if (value.length > 0) {
-            $("table tr").each(function(index) {
-                if (index != 0) {
-
-                    $row = $(this);
-
-                    var id = $row.find("td:first").text();
-                    id = $.trim( id);
-                    id = id.substr( 0, value.length);
-                    if (id == value )
-                    {
-                        $(this).slideDown();
-                    }
-                    else {
-                        $(this).slideUp();
+    </div>
+
+    @stop
+    @section('scripts')
+    @parent
+    <script type="text/javascript">
+        $(".view-cr").click(function () {
+            alert("The functionality to view a Compute Resource is under construction.");
+        });
+        $('.filterinput').keyup(function () {
+            var value = $(this).val();
+            if (value.length > 0) {
+                $("table tr").each(function (index) {
+                    if (index != 0) {
+
+                        $row = $(this);
+
+                        var id = $row.find("td:first").text();
+                        id = $.trim(id);
+                        id = id.substr(0, value.length);
+                        if (id == value) {
+                            $(this).slideDown();
+                        }
+                        else {
+                            $(this).slideUp();
+                        }
                     }
-                }
-            });
-        } else {
-            $("table tr").slideDown();
-        }
-        return false;
-    });
-
-    $(".del-cr").click( function(){
-    	$(".delete-cr-name").html( "'" + $(this).data("delete-cr-name") + "'");
-    	$(".delete-crId").val( $(this).data("crid"));
-    	$(".deploymentCount").html( $(this).data("deployment-count"));
-    });
+                });
+            } else {
+                $("table tr").slideDown();
+            }
+            return false;
+        });
+
+        $(".del-cr").click(function () {
+            $(".delete-cr-name").html("'" + $(this).data("delete-cr-name") + "'");
+            $(".delete-crId").val($(this).data("crid"));
+            $(".deploymentCount").html($(this).data("deployment-count"));
+        });
     </script>
-@stop
\ No newline at end of file
+    @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/resource/create-step3.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/create-step3.blade.php b/app/views/resource/create-step3.blade.php
index 39f6bfe..6fd12b7 100644
--- a/app/views/resource/create-step3.blade.php
+++ b/app/views/resource/create-step3.blade.php
@@ -1,32 +1,33 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/style.css') }}
+@parent
+{{ HTML::style('css/style.css') }}
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-		<h3>Add Resource Data</h3>
-		<form role="form" method="POST" action="{{ URL::to('/') }}/cr/create">
+    <div class="col-md-offset-2 col-md-8">
+        <h3>Add Resource Data</h3>
 
-		
-		</form>
-	</div>
+        <form role="form" method="POST" action="{{ URL::to('/') }}/cr/create">
+
+
+        </form>
+    </div>
 </div>
 
 @stop
 
 @section('scripts')
-	@parent
-    {{ HTML::script('js/script.js') }}
+@parent
+{{ HTML::script('js/script.js') }}
+
+<script>
+    $(document).ready(function () {
 
-	<script>
-		$(document).ready( function(){
 
-			
-		});
-	</script>
+    });
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/resource/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/resource/create.blade.php b/app/views/resource/create.blade.php
index df301c4..913e7fc 100644
--- a/app/views/resource/create.blade.php
+++ b/app/views/resource/create.blade.php
@@ -1,44 +1,45 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="container">
-	<div class="col-md-offset-2 col-md-8">
-		<h3>Create a Resource</h3>
-		<form role="form" method="POST" action="{{ URL::to('/') }}/cr/create">
-			<div class="form-group required">
-				<label class="control-label">Host Name</label>
-				<input class="form-control hostName" maxlength="100" name="hostname" required="required"/>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Host Aliases</label>
-				<input class="form-control" maxlength="30" name="hostaliases[]"/>
-				<button type="button" class="btn btn-sm btn-default add-alias">Add More Aliases</button>
-			</div>
-			<div class="form-group">
-				<label class="control-label">IP Addresses</label>
-				<input class="form-control" maxlength="30" name="ips[]"/>
-				<button type="button" class="btn btn-sm btn-default add-ip">Add More IP Addresses</button>
-			</div>
-			<div class="form-group">
-				<label class="control-label">Resource Description</label>
-				<textarea class="form-control" maxlength="255" name="description"></textarea>
-			</div>
-			<div class="form-group">
-				<input type="submit" class="btn btn-lg btn-primary" name="step1" value="Create"/>
-				<input type="reset" class="btn btn-lg btn-success" value="Reset"/>
-			</div>
-		</form>
-	</div>
+    <div class="col-md-offset-2 col-md-8">
+        <h3>Create a Resource</h3>
+
+        <form role="form" method="POST" action="{{ URL::to('/') }}/cr/create">
+            <div class="form-group required">
+                <label class="control-label">Host Name</label>
+                <input class="form-control hostName" maxlength="100" name="hostname" required="required"/>
+            </div>
+            <div class="form-group">
+                <label class="control-label">Host Aliases</label>
+                <input class="form-control" maxlength="30" name="hostaliases[]"/>
+                <button type="button" class="btn btn-sm btn-default add-alias">Add More Aliases</button>
+            </div>
+            <div class="form-group">
+                <label class="control-label">IP Addresses</label>
+                <input class="form-control" maxlength="30" name="ips[]"/>
+                <button type="button" class="btn btn-sm btn-default add-ip">Add More IP Addresses</button>
+            </div>
+            <div class="form-group">
+                <label class="control-label">Resource Description</label>
+                <textarea class="form-control" maxlength="255" name="description"></textarea>
+            </div>
+            <div class="form-group">
+                <input type="submit" class="btn btn-lg btn-primary" name="step1" value="Create"/>
+                <input type="reset" class="btn btn-lg btn-success" value="Reset"/>
+            </div>
+        </form>
+    </div>
 </div>
 
 @stop
 
 @section('scripts')
-	@parent
-    {{ HTML::script('js/script.js') }}
+@parent
+{{ HTML::script('js/script.js') }}
 @stop
\ No newline at end of file


[07/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/libraries/Utilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/Utilities.php b/app/libraries/Utilities.php
deleted file mode 100644
index cdceb25..0000000
--- a/app/libraries/Utilities.php
+++ /dev/null
@@ -1,2145 +0,0 @@
-<?php
-
-//Airavata classes - loaded from app/libraries/Airavata
-use Airavata\API\Error\InvalidRequestException;
-use Airavata\API\Error\AiravataClientException;
-use Airavata\API\Error\AiravataSystemException;
-use Airavata\API\Error\ExperimentNotFoundException;
-use Airavata\Model\Workspace\Experiment\ComputationalResourceScheduling;
-use Airavata\Model\AppCatalog\AppInterface\InputDataObjectType;
-use Airavata\Model\Workspace\Experiment\UserConfigurationData;
-use Airavata\Model\Workspace\Experiment\AdvancedOutputDataHandling;
-use Airavata\Model\Workspace\Experiment\Experiment;
-use Airavata\Model\Workspace\Experiment\ExperimentState;
-use Airavata\Model\AppCatalog\AppInterface\DataType;
-use Airavata\Model\Workspace\Project;
-use Airavata\Model\Workspace\Experiment\JobState;
-
-
-
-class Utilities{
-/**
- * Basic utility functions
- */
-
-/*
-
-************* IMPORTANT ************
-
-READ :: ALL CONSTANTS ARE NOW BEING CALLED FROM app/models/Constant.php. 
-
-************* IMPORTANT ************
-*/
-private $tokenFilePath = 'tokens.xml';
-private $tokenFile = null;
-
-private $sshUser;
-private $hostName;
-private static $pathConstant;
-private static $experimentPath;
-private static $experimentDataPathAbsolute;
-
-function __construct(){
-	$this->sshUser = "root";
-	$this->hostName = $_SERVER['SERVER_NAME'];
-
-    self::$experimentDataPathAbsolute = base_path() . Constant::EXPERIMENT_DATA_ROOT;
-	self::$pathConstant = 'file://'.$this->sshUser.'@'.$this->hostName.':' . self::$experimentDataPathAbsolute;
-	self::$experimentPath = null;
-}
-
-/**
- * Print success message
- * @param $message
- */
-public static function print_success_message($message)
-{
-    echo '<div class="alert alert-success">' . $message . '</div>';
-}
-
-/**
- * Print warning message
- * @param $message
- */
-public static function print_warning_message($message)
-{
-    echo '<div class="alert alert-warning">' . $message . '</div>';
-}
-
-/**
- * Print error message
- * @param $message
- */
-public static function print_error_message($message)
-{
-    echo '<div class="alert alert-danger">' . $message . '</div>';
-}
-
-/**
- * Print info message
- * @param $message
- */
-public static function print_info_message($message)
-{
-    echo '<div class="alert alert-info">' . $message . '</div>';
-}
-
-/**
- * Redirect to the given url
- * @param $url
- */
-public static function redirect($url)
-{
-    echo '<meta http-equiv="Refresh" content="0; URL=' . $url . '">';
-}
-
-/**
- * Return true if the form has been submitted
- * @return bool
- */
-public static function form_submitted()
-{
-    return isset($_POST['Submit']);
-}
-
-/**
- * Store username in session variables
- * @param $username
- */
-public static function store_id_in_session($username)
-{
-    Session::put('username', $username );
-    Session::put('loggedin', true);
-}
-
-/**
- * Return true if the username stored in the session
- * @return bool
- */
-public static function id_in_session()
-{
-    if( Session::has("username") && Session::has('loggedin') )
-        return true;
-    else
-        return false;
-}
-
-/**
- * Verify if the user is already logged in. If not, redirect to the home page.
- */
-public static function verify_login()
-{
-    if (Utilities::id_in_session())
-    {
-        return true;
-    }
-    else
-    {
-        Utilities::print_error_message('User is not logged in!');
-        return false;
-    }
-}
-
-/**
- * Launch the experiment with the given ID
- * @param $expId
- */
-public static function launch_experiment($expId)
-{
-    //global $tokenFilePath;
-    try
-    {
-        /* temporarily using hard-coded token
-        open_tokens_file($tokenFilePath);
-
-        $communityToken = $tokenFile->tokenId;
-
-
-        $token = isset($_SESSION['tokenId'])? $_SESSION['tokenId'] : $communityToken;
-
-        $airavataclient->launchExperiment($expId, $token);
-
-        $tokenString = isset($_SESSION['tokenId'])? 'personal' : 'community';
-
-        Utilities::print_success_message('Experiment launched using ' . $tokenString . ' allocation!');
-        */
-
-        $hardCodedToken = Config::get('pga_config.airavata')['credential-store-token'];
-        Airavata::launchExperiment($expId, $hardCodedToken);
-
-        /*
-        Utilities::print_success_message('Experiment launched!');
-        Utilities::print_success_message("<p>Experiment launched!</p>" .
-            '<p>You will be redirected to the summary page shortly, or you can
-            <a href="experiment_summary.php?expId=' . $expId . '">go directly</a> to the experiment summary page.</p>');
-        redirect('experiment_summary.php?expId=' . $expId);
-        */
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem launching the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (ExperimentNotFoundException $enf)
-    {
-        Utilities::print_error_message('<p>There was a problem launching the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem launching the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem launching the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
-    }
-    catch (Exception $e)
-    {
-        Utilities::print_error_message('<p>There was a problem launching the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Exception: ' . $e->getMessage() . '</p>');
-    }
-}
-
-/**
- * Get all projects owned by the given user
- * @param $username
- * @return null
- */
-public static function get_all_user_projects($gatewayId, $username)
-{
-    $userProjects = null;
-
-    try
-    {
-        $userProjects = Airavata::getAllUserProjects($gatewayId, $username);
-        //var_dump( $userProjects); exit;
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the user\'s projects.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage(). '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the user\'s projects.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage(). '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-        {
-            Utilities::print_warning_message('<p>You must create a project before you can create an experiment.
-                Click <a href="' . URL::to('/') . '/project/create">here</a> to create a project.</p>');
-        }
-        else
-        {
-            Utilities::print_error_message('<p>There was a problem getting the user\'s projects.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
-        }
-    }
-
-    return $userProjects;
-}
-
-
-/**
- * Get all available applications
- * @return null
- */
-public static function get_all_applications()
-{
-    $applications = null;
-
-    try
-    {
-        $applications = Airavata::getAllApplicationInterfaceNames( Session::get("gateway_id"));
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting all applications.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting all applications.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_warning_message('<p>You must create an application module, interface and deployment space before you can create an experiment.
-                Click <a href="' . URL::to('/') . '/app/module">here</a> to create an application.</p>');
-        /*
-        Utilities::print_error_message('<p>There was a problem getting all applications.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
-            */
-    }
-
-    if( count( $applications) == 0)
-        Utilities::print_warning_message('<p>You must create an application module, interface and deployment space before you can create an experiment.
-                Click <a href="' . URL::to('/') . '/app/module">here</a> to create an application.</p>');
-        
-
-    return $applications;
-}
-
-
-/**
- * Get the interface for the application with the given ID
- * @param $id
- * @return null
- */
-public static function get_application_interface($id)
-{
-    $applicationInterface = null;
-
-    try
-    {
-        $applicationInterface = Airavata::getApplicationInterface($id);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the application interface.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage(). '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the application interface.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the application interface.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
-    }
-
-    return $applicationInterface;
-}
-
-
-/**
- * Get a list of compute resources available for the given application ID
- * @param $id
- * @return null
- */
-public static function get_available_app_interface_compute_resources($id)
-{
-    $computeResources = null;
-
-    try
-    {
-        $computeResources = Airavata::getAvailableAppInterfaceComputeResources($id);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting compute resources.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting compute resources.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting compute resources.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
-    }
-
-    return $computeResources;
-}
-
-
-/**
- * Get the ComputeResourceDescription with the given ID
- * @param $id
- * @return null
- */
-public static function get_compute_resource($id)
-{
-    $computeResource = null;
-
-    try
-    {
-        $computeResource = Airavata::getComputeResource($id);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the compute resource.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the compute resource.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the compute resource.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
-    }
-
-    return $computeResource;
-}
-
-
-/**
- * List the experiment's input files
- * @param $experiment
- */
-public static function list_input_files($experiment)
-{
-    $applicationInputs = Utilities::get_application_inputs($experiment->applicationId);
-
-    $experimentInputs = $experiment->experimentInputs;
-
-
-    //showing experiment inputs in the order defined by the admins.
-    $order = array();
-    foreach ($experimentInputs as $index => $input)
-    {
-        $order[$index] = $input->inputOrder;
-    }
-    array_multisort($order, SORT_ASC, $experimentInputs);
-    
-    foreach ($experimentInputs as $input)
-    {
-        $matchingAppInput = null;
-
-        foreach($applicationInputs as $applicationInput)
-        {
-            if ($input->name == $applicationInput->name)
-            {
-                $matchingAppInput = $applicationInput;
-            }
-        }
-        //var_dump($matchingAppInput);
-
-        if ($matchingAppInput->type == DataType::URI)
-        {
-            $explode = explode('/', $input->value);
-            echo '<p><a target="_blank"
-                        href="' . URL::to("/") . "/../../" . Constant::EXPERIMENT_DATA_ROOT . $explode[sizeof($explode)-2] . '/' . $explode[sizeof($explode)-1] . '">' .
-                $explode[sizeof($explode)-1] . '
-                <span class="glyphicon glyphicon-new-window"></span></a></p>';
-        }
-        elseif ($matchingAppInput->type == DataType::STRING)
-        {
-            echo '<p>' . $input->name . ': ' . $input->value . '</p>';
-        }
-    }
-}
-
-
-/**
- * Get a list of the inputs for the application with the given ID
- * @param $id
- * @return null
- */
-public static function get_application_inputs($id)
-{
-    $inputs = null;
-
-    try
-    {
-        $inputs = Airavata::getApplicationInputs($id);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting application inputs.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting application inputs.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting application inputs.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
-    }
-
-    return $inputs;
-}
-
-
-/**
- * Get a list of the outputs for the application with the given ID
- * @param $id
- * @return null
- */
-public static function get_application_outputs($id)
-{
-    $outputs = null;
-
-    try
-    {
-        $outputs = Airavata::getApplicationOutputs($id);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting application outputs.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting application outputs.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata Client Exception: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting application outputs.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Airavata System Exception: ' . $ase->getMessage() . '</p>');
-    }
-
-    return $outputs;
-}
-
-
-/**
- * Get the experiment with the given ID
- * @param $expId
- * @return null
- */
-public static function get_experiment($expId)
-{
-
-    try
-    {
-        return Airavata::getExperiment($expId);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (ExperimentNotFoundException $enf)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
-    }
-    catch (TTransportException $tte)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>TTransportException: ' . $tte->getMessage() . '</p>');
-    }
-    catch (Exception $e)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Exception: ' . $e->getMessage() . '</p>');
-    }
-
-}
-
-/**
- * Get the project with the given ID
- * @param $projectId
- * @return null
- */
-public static function get_project($projectId)
-{
-
-    try
-    {
-        return Airavata::getProject($projectId);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the project.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the project.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem getting the project.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException!<br><br>' . $ase->getMessage() . '</p>');
-    }
-
-}
-
-
-/**
- * Create and configure a new Experiment
- * @return Experiment
- */
-public static function assemble_experiment()
-{
-    $utility = new Utilities();
-    $experimentInputs = array();
-
-    $scheduling = new ComputationalResourceScheduling();
-    $scheduling->totalCPUCount = $_POST['cpu-count'];
-    $scheduling->nodeCount = $_POST['node-count'];
-    $scheduling->queueName = $_POST['queue-name'];
-    $scheduling->wallTimeLimit = $_POST['wall-time'];    
-    $scheduling->totalPhysicalMemory = $_POST['total-physical-memory'];
-    $scheduling->resourceHostId = $_POST['compute-resource'];
-
-    $userConfigData = new UserConfigurationData();
-    $userConfigData->computationalResourceScheduling = $scheduling;
-    if( isset( $_POST["userDN"]) )
-    {        
-        $userConfigData->generateCert = 1;
-        $userConfigData->userDN = $_POST["userDN"];
-    }
-
-    $applicationInputs = Utilities::get_application_inputs($_POST['application']);
-    $experimentInputs = Utilities::process_inputs($applicationInputs, $experimentInputs);
-
-    if( Utilities::$experimentPath == null){
-        Utilities::create_experiment_folder_path();
-    }
-
-    $advHandling = new AdvancedOutputDataHandling();
-
-    $advHandling->outputDataDir = str_replace( base_path() . Constant::EXPERIMENT_DATA_ROOT, Utilities::$pathConstant , Utilities::$experimentPath);
-    $userConfigData->advanceOutputDataHandling = $advHandling;
-
-    //TODO: replace constructor with a call to airvata to get a prepopulated experiment template
-    $experiment = new Experiment();
-
-    // required
-    $experiment->projectID = $_POST['project'];
-    $experiment->userName = Session::get( 'username');
-    $experiment->name = $_POST['experiment-name'];
-
-    // optional
-    $experiment->description = $_POST['experiment-description'];
-    $experiment->applicationId = $_POST['application'];
-    $experiment->userConfigurationData = $userConfigData;
-    $experiment->experimentInputs = $experimentInputs;
-    if( isset( $_POST["enableEmailNotification"]))
-    {
-        $experiment->enableEmailNotification = intval( $_POST["enableEmailNotification"] );
-        $experiment->emailAddresses = array_unique( array_filter( $_POST["emailAddresses"], "trim") );
-    }
-
-    // adding default experiment outputs for now till prepoulated experiment template is not implemented.
-    $experiment->experimentOutputs = Utilities::get_application_outputs( $_POST["application"]);
-
-    if ($experimentInputs)
-    {
-        return $experiment;
-    }
-}
-
-/**
- * @param $applicationInputs
- * @param $experimentInputs
- * @internal param $environmentPath
- * @return array
- */
-public static function process_inputs($applicationInputs, $experimentInputs)
-{
-    $utility = new Utilities();
-    $experimentAssemblySuccessful = true;
-    $newExperimentInputs = array();
-
-    //var_dump($_FILES);
-
-    if (sizeof($_FILES) > 0)
-    {
-        if (Utilities::file_upload_successful())
-        {
-            // construct unique path
-            Utilities::create_experiment_folder_path();
-        }
-        else
-        {
-            $experimentAssemblySuccessful = false;
-        }
-    }
-
-    //sending application inputs in the order defined by the admins.
-    $order = array();
-    foreach ($applicationInputs as $index => $input)
-    {
-        $order[$index] = $input->inputOrder;
-    }
-    array_multisort($order, SORT_ASC, $applicationInputs);
-    
-    foreach ($applicationInputs as $applicationInput)
-    {
-        $experimentInput = new InputDataObjectType();
-        $experimentInput = $applicationInput;
-        //$experimentInput->name = $applicationInput->name;
-        //$experimentInput->metaData = $applicationInput->metaData;
-
-
-        //$experimentInput->type = $applicationInput->type;
-        //$experimentInput->type = DataType::STRING;
-
-
-        if(($applicationInput->type == DataType::STRING) ||
-            ($applicationInput->type == DataType::INTEGER) ||
-            ($applicationInput->type == DataType::FLOAT))
-        {
-            if (isset($_POST[$applicationInput->name]) && (trim($_POST[$applicationInput->name]) != ''))
-            {
-                $experimentInput->value = $_POST[$applicationInput->name];
-                $experimentInput->type = $applicationInput->type;
-
-            }
-            else // use previous value
-            {
-                $index = -1;
-                for ($i = 0; $i < sizeof($experimentInputs); $i++)
-                {
-                    if ($experimentInputs[$i]->name == $applicationInput->name)
-                    {
-                        $index = $i;
-                    }
-                }
-
-                if ($index >= 0)
-                {
-                    $experimentInput->value = $experimentInputs[$index]->value;
-                    $experimentInput->type = $applicationInput->type;
-                }
-            }
-        }
-        elseif ($applicationInput->type == DataType::URI)
-        {
-            //var_dump($_FILES[$applicationInput->name]->name);
-            if ($_FILES[$applicationInput->name]['name'])
-            {
-                $file = $_FILES[$applicationInput->name];
-
-
-                //
-                // move file to experiment data directory
-                //
-                $filePath = Utilities::$experimentPath . $file['name'];
-
-                // check if file already exists
-                if (is_file($filePath))
-                {
-                    unlink($filePath);
-
-                    Utilities::print_warning_message('Uploaded file already exists! Overwriting...');
-                }
-
-                $moveFile = move_uploaded_file($file['tmp_name'], $filePath);
-
-                if ($moveFile)
-                {
-                    Utilities::print_success_message('Upload: ' . $file['name'] . '<br>' .
-                        'Type: ' . $file['type'] . '<br>' .
-                        'Size: ' . ($file['size']/1024) . ' kB');//<br>' .
-                        //'Stored in: ' . $experimentPath . $file['name']);
-                }
-                else
-                {
-                    Utilities::print_error_message('<p>Error moving uploaded file ' . $file['name'] . '!
-                    Please try again later or report a bug using the link in the Help menu.</p>');
-                    $experimentAssemblySuccessful = false;
-                }
-
-                $experimentInput->value = str_replace(base_path() . Constant::EXPERIMENT_DATA_ROOT, Utilities::$pathConstant , $filePath);
-                $experimentInput->type = $applicationInput->type;
-                
-            }
-            else
-            {
-                $index = -1;
-                for ($i = 0; $i < sizeof($experimentInputs); $i++)
-                {
-                    if ($experimentInputs[$i]->name == $applicationInput->name)
-                    {
-                        $index = $i;
-                    }
-                }
-
-                if ($index >= 0)
-                {
-                    $experimentInput->value = $experimentInputs[$index]->value;
-                    $experimentInput->type = $applicationInput->type;
-                }
-            }
-
-        }
-        else
-        {
-            Utilities::print_error_message('I cannot accept this input type yet!');
-        }
-
-
-
-
-
-
-
-        //$experimentInputs[] = $experimentInput;
-        /*
-        $index = -1;
-        for ($i = 0; $i < sizeof($experimentInputs); $i++)
-        {
-            if ($experimentInputs[$i]->key == $experimentInput->key)
-            {
-                $index = $i;
-            }
-        }
-
-        if ($index >= 0)
-        {
-            unset($experimentInputs[$index]);
-        }
-        */
-        //$experimentInputs[] = $experimentInput;
-
-
-
-
-
-        $newExperimentInputs[] = $experimentInput;
-
-
-    }
-
-    if ($experimentAssemblySuccessful)
-    {
-        return $newExperimentInputs;
-    }
-    else
-    {
-        return false;
-    }
-
-}
-
-
-public static function create_experiment_folder_path()
-{
-    do
-    {
-        Utilities::$experimentPath = base_path() . Constant::EXPERIMENT_DATA_ROOT . str_replace(' ', '', Session::get('username') ) . md5(rand() * time()) . '/';
-    }
-    while (is_dir( Utilities::$experimentPath)); // if dir already exists, try again
-    // create upload directory
-    if (!mkdir( Utilities::$experimentPath))
-    {
-        Utilities::print_error_message('<p>Error creating upload directory!
-            Please try again later or report a bug using the link in the Help menu.</p>');
-        $experimentAssemblySuccessful = false;
-    }
-}
-
-/**
- * Check the uploaded files for errors
- */
-public static function file_upload_successful()
-{
-    $uploadSuccessful = true;
-
-    foreach ($_FILES as $file)
-    {
-        //var_dump($file);
-        if($file['name'])
-        {
-            if ($file['error'] > 0)
-            {
-                $uploadSuccessful = false;
-                Utilities::print_error_message('<p>Error uploading file ' . $file['name'] . ' !
-                    Please try again later or report a bug using the link in the Help menu.');
-            }/*
-            elseif ($file['type'] != 'text/plain')
-            {
-                $uploadSuccessful = false;
-                Utilities::print_error_message('Uploaded file ' . $file['name'] . ' type not supported!');
-            }
-            elseif (($file['size'] / 1024) > 20)
-            {
-                $uploadSuccessful = false;
-                Utilities::print_error_message('Uploaded file ' . $file['name'] . ' must be smaller than 10 MB!');
-            }*/
-        }
-
-
-    }
-
-    return $uploadSuccessful;
-}
-
-
-/**
- * Update the experiment with the given ID
- * @param $expId
- * @param $updatedExperiment
- */
-public static function update_experiment($expId, $updatedExperiment)
-{
-    try
-    {
-        Airavata::updateExperiment($expId, $updatedExperiment);
-
-        /*
-        Utilities::print_success_message("<p>Experiment updated!</p>" .
-            '<p>Click
-            <a href="' . URL::to('/') . '/experiment/summary?expId=' . $expId . '">here</a> to visit the experiment summary page.</p>');
-        */
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem updating the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (ExperimentNotFoundException $enf)
-    {
-        Utilities::print_error_message('<p>There was a problem updating the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem updating the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem updating the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
-    }
-
-}
-
-
-/**
- * Clone the experiment with the given ID
- * @param $expId
- */
-public static function clone_experiment($expId)
-{
-    try
-    {
-        //create new experiment to receive the clone
-        $experiment = Airavata::getExperiment($expId);
-
-        $cloneId = Airavata::cloneExperiment($expId, 'Clone of ' . $experiment->name);
-
-        Utilities::print_success_message("<p>Experiment cloned!</p>" .
-            '<p>You will be redirected to the edit page shortly, or you can
-            <a href="edit_experiment.php?expId=' . $cloneId . '">go directly</a> to the edit experiment page.</p>');
-        //redirect('edit_experiment.php?expId=' . $cloneId);
-        return $cloneId;
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem cloning the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (ExperimentNotFoundException $enf)
-    {
-        Utilities::print_error_message('<p>There was a problem cloning the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem cloning the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem cloning the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
-    }
-    catch (TTransportException $tte)
-    {
-        Utilities::print_error_message('<p>There was a problem cloning the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>TTransportException: ' . $tte->getMessage() . '</p>');
-    }
-}
-
-/**
- * Cancel the experiment with the given ID
- * @param $expId
- */
-public static function cancel_experiment($expId)
-{
-
-    try
-    {
-        Airavata::terminateExperiment($expId, Config::get('pga_config.airavata')["credential-store-token"]);
-
-        Utilities::print_success_message("Experiment canceled!");
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('<p>There was a problem canceling the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
-    }
-    catch (ExperimentNotFoundException $enf)
-    {
-        Utilities::print_error_message('<p>There was a problem canceling the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('<p>There was a problem canceling the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('<p>There was a problem canceling the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
-    }
-    catch (TTransportException $tte)
-    {
-        Utilities::print_error_message('<p>There was a problem canceling the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>TTransportException: ' . $tte->getMessage() . '</p>');
-    }
-    catch (Exception $e)
-    {
-        Utilities::print_error_message('<p>There was a problem canceling the experiment.
-            Please try again later or submit a bug report using the link in the Help menu.</p>' .
-            '<p>Exception: ' . $e->getMessage() . '</p>');
-    }
-}
-
-
-/**
- * Create a select input and populate it with project options from the database
- */
-public static function create_project_select($projectId = null, $editable = true)
-{
-    $editable? $disabled = '' : $disabled = 'disabled';
-    $userProjects = Utilities::get_all_user_projects( Session::get("gateway_id"), Session::get('username') );
-
-    echo '<select class="form-control" name="project" id="project" required ' . $disabled . '>';
-    if (sizeof($userProjects) > 0)
-    {
-        foreach ($userProjects as $project)
-        {
-            if ($project->projectID == $projectId)
-            {
-                $selected = 'selected';
-            }
-            else
-            {
-                $selected = '';
-            }
-
-            echo '<option value="' . $project->projectID . '" ' . $selected . '>' . $project->name . '</option>';
-        }
-    }
-    echo '</select>';
-    if( sizeof($userProjects) == 0 )
-    {
-        Utilities::print_warning_message('<p>You must create a project before you can create an experiment.
-                Click <a href="' . URL::to('/') . '/project/create">here</a> to create a project.</p>');
-    }
-}
-
-
-/**
- * Create a select input and populate it with applications options
- * @param null $id
- * @param bool $editable
- */
-public static function create_application_select($id = null, $editable = true)
-{
-    $disabled = $editable? '' : 'disabled';
-
-    $applicationIds = Utilities::get_all_applications();
-
-    echo '<select class="form-control" name="application" id="application" required ' . $disabled . '>';
-
-    if( count( $applicationIds))
-    {
-        foreach ( (array) $applicationIds as $applicationId => $applicationName)
-        {
-            $selected = ($applicationId == $id) ? 'selected' : '';
-    
-            echo '<option value="' . $applicationId . '" ' . $selected . '>' . $applicationName . '</option>';
-        }
-    }
-
-    echo '</select>';
-}
-
-
-/**
- * Create a select input and populate it with compute resources
- * available for the given application ID
- * @param $applicationId
- * @param $resourceHostId
- */
-public static function create_compute_resources_select($applicationId, $resourceHostId)
-{
-    return Utilities::get_available_app_interface_compute_resources($applicationId);
-}
-
-
-/**
- * Create form inputs to accept the inputs to the given application
- * @param $id
- * @param $isRequired
- * @internal param $required
- */
-public static function create_inputs($id, $isRequired)
-{
-    $inputs = Utilities::get_application_inputs($id);
-
-    $required = $isRequired? ' required' : '';
-
-    //var_dump( $inputs);  echo "<br/>after sort<br/>";
-    //arranging inputs in ascending order.
-    foreach ($inputs as $index => $input)
-    {
-        $order[$index] = $input->inputOrder;
-    }
-    array_multisort($order, SORT_ASC, $inputs);
-    //var_dump( $inputs); exit;
-    foreach ($inputs as $input)
-    {
-        switch ($input->type)
-        {
-            case DataType::STRING:
-                echo '<div class="form-group">
-                    <label for="experiment-input">' . $input->name . '</label>
-                    <input value="' . $input->value . '" type="text" class="form-control" name="' . $input->name .
-                    '" id="' . $input->name .
-                    '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '>
-                    </div>';
-                break;
-            case DataType::INTEGER:
-            echo '<div class="form-group">
-                    <label for="experiment-input">' . $input->name . '</label>
-                    <input value="' . $input->value . '" type="number" class="form-control" name="' . $input->name .
-                    '" id="' . $input->name .
-                    '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '>
-                    </div>';
-                break;
-            case DataType::FLOAT:
-                echo '<div class="form-group">
-                    <label for="experiment-input">' . $input->name . '</label>
-                    <input value="' . $input->value . '" type="number" step="0.01" class="form-control" name="' . $input->name .
-                    '" id="' . $input->name .
-                    '" placeholder="' . $input->userFriendlyDescription . '"' . $required . '>
-                    </div>';
-                break;
-            case DataType::URI:
-                echo '<div class="form-group">
-                    <label for="experiment-input">' . $input->name . '</label>
-                    <input class="file-input" type="file" name="' . $input->name .
-                    '" id="' . $input->name . '" ' . $required . '>
-                    <p class="help-block">' . $input->userFriendlyDescription . '</p>
-                    </div>';
-                break;
-            default:
-                Utilities::print_error_message('Input data type not supported!
-                    Please file a bug report using the link in the Help menu.');
-                break;
-        }
-    }
-}
-
-
-/**
- * Create navigation bar
- * Used for all pages
- */
-public static function create_nav_bar()
-{
-	$menus = array();
-/*
-	if( Session::has('loggedin'))
-	{
-	    $menus = array
-	    (
-	        'Project' => array
-	        (
-	            array('label' => 'Create Project', 'url' => URL::to('/') . '/project/create'),
-	            array('label' => 'Search Projects', 'url' => URL::to('/') . '/project/search')
-	        ),
-	        'Experiment' => array
-	        (
-	            array('label' => 'Create Experiment', 'url' => URL::to('/') . '/experiment/create'),
-	            array('label' => 'Search Experiments', 'url' => URL::to('/') . '/experiment/search')
-	        ),
-	        'Compute Resource' => array
-	        (
-	            array('label' => 'Register', 'url' => URL::to('/') . '/cr/create'),
-	            array('label' => 'Browse', 'url' => URL::to('/') . '/cr/browse')
-	        ),
-	        'App Catalog' => array
-	        (
-	            array('label' => 'Module', 'url' => URL::to('/') . '/app/module'),
-	            array('label' => 'Interface', 'url' => URL::to('/') . '/app/interface'),
-	            array('label' => 'Deployment', 'url' => URL::to('/') . '/app/deployment')
-	        ),
-	        'Help' => array
-	        (
-	            array('label' => 'Report Issue', 'url' => '#'),
-	            array('label' => 'Request Feature', 'url' => '#')
-	        )
-	    );
-	}
-*/
-	if( Session::has('loggedin'))
-	{
-	    $menus = array
-	    (
-	        'Project' => array
-	        (
-	            array('label' => 'Create', 'url' => URL::to('/') . '/project/create', "nav-active" => "project"),
-	            array('label' => 'Search', 'url' => URL::to('/') . '/project/search', "nav-active"=> "project"),
-                array('label' => 'Browse', 'url' => URL::to('/') . '/project/browse', "nav-active" => "project")
-	        ),
-	        'Experiment' => array
-	        (
-	            array('label' => 'Create', 'url' => URL::to('/') . '/experiment/create', "nav-active" => "experiment"),
-	            array('label' => 'Search', 'url' => URL::to('/') . '/experiment/search', "nav-active" => "experiment"),
-                array('label' => 'Browse', 'url' => URL::to('/') . '/experiment/browse', "nav-active" => "experiment")
-	        )
-	    );
-
-	    if( Session::has("admin"))
-	    {
-	    	$menus['Compute Resource'] = array
-	        (
-	            array('label' => 'Register', 'url' => URL::to('/') . '/cr/create', "nav-active" => "compute-resource"),
-	            array('label' => 'Browse', 'url' => URL::to('/') . '/cr/browse', "nav-active" => "compute-resource")
-	        );
-	        $menus['App Catalog'] = array
-	        (
-	            array('label' => 'Module', 'url' => URL::to('/') . '/app/module', "nav-active" => "app-catalog"),
-	            array('label' => 'Interface', 'url' => URL::to('/') . '/app/interface', "nav-active" => "app-catalog"),
-	            array('label' => 'Deployment', 'url' => URL::to('/') . '/app/deployment', "nav-active" => "app-catalog")
-	        );
-            /*
-            $menus['Gateway Profile'] = array
-            (
-
-                array('label' => 'Register', 'url' => URL::to('/') . '/gp/create', "nav-active" => "gateway-profile"),
-                array('label' => 'Browse', 'url' => URL::to('/') . '/gp/browse', "nav-active" => "gateway-profile")
-            );
-            */
-               
-	    }
-        
-        $menus['Help'] = array
-        (
-            array('label' => 'Report Issue', 'url' => '#', "nav-active", ""),
-            array('label' => 'Request Feature', 'url' => '#', "nav-active", "")
-        );
-	}
-
-    $selfExplode = explode('/', $_SERVER['PHP_SELF']);
-
-
-
-    // nav bar and left-aligned content
-
-    echo '<nav class="navbar navbar-inverse navbar-static-top" role="navigation">
-            <div class="container-fluid">
-                <!-- Brand and toggle get grouped for better mobile display -->
-                <div class="navbar-header">
-                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
-                       <span class="sr-only">Toggle navigation</span>
-                       <span class="icon-bar"></span>
-                       <span class="icon-bar"></span>
-                       <span class="icon-bar"></span>
-                    </button>
-                    <a class="navbar-brand" href="' . URL::to('home') . '" title="PHP Gateway with Airavata">PGA</a>
-                </div>
-
-                <!-- Collect the nav links, forms, and other content for toggling -->
-                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
-                    <ul class="nav navbar-nav">';
-
-
-    foreach ($menus as $label => $options)
-    {
-        Session::has('loggedin') ? $disabled = '' : $disabled = ' class="disabled"';
-
-        $active = "";
-        if( Session::has("nav-active") && isset( $options[0]['nav-active'] ) )
-        {
-	        if( $options[0]['nav-active'] == Session::get("nav-active"))
-	        	$active = " active ";
-        }
-        echo '<li class="dropdown ' . $active . '">
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . $label . '<span class="caret"></span></a>
-                <ul class="dropdown-menu" role="menu">';
-
-        if( Session::has('loggedin'))
-        {
-	        foreach ($options as $option)
-	        {
-	            $id = strtolower(str_replace(' ', '-', $option['label']));
-
-	            echo '<li' . $disabled . '><a href="' . $option['url'] . '" id=' . $id . '>' . $option['label'] . '</a></li>';
-	        }
-	    }
-
-        echo '</ul>
-        </li>';
-    }
-
-
-    echo '</ul>
-
-        <ul class="nav navbar-nav navbar-right">';
-
-    // right-aligned content
-
-    if ( Session::has('loggedin') )
-    {
-        $active = "";
-        if( Session::has("nav-active") )
-        {
-            if( "user-console" == Session::get("nav-active"))
-                $active = " active ";
-        }
-        if( Session::has("admin"))
-            echo '<li><a href="' . URL::to("/") . '/admin/dashboard"><span class="glyphicon glyphicon-user"></span> Dashboard</a></li>';
-        else
-            echo '<li><a href="' . URL::to("/") . '/user/profile"><span class="glyphicon glyphicon-user"></span> Profile</a></li>';
-
-        echo '<li class="dropdown ' . $active . '">
-
-                <a href="#" class="dropdown-toggle" data-toggle="dropdown">' . Session::get("username") . ' <span class="caret"></span></a>';
-        echo '<ul class="dropdown-menu" role="menu">';
-
-        echo '<li><a href="' . URL::to('/') . '/logout"><span class="glyphicon glyphicon-log-out"></span> Log out</a></li>';
-        echo    '</ul></li></ul>';
-    }
-    else
-    {
-        echo '<li><a href="' . URL::to('/') . '/create"><span class="glyphicon glyphicon-user"></span> Create account</a></li>';
-        echo '<li><a href="' . URL::to('/') . '/login"><span class="glyphicon glyphicon-log-in"></span> Log in</a></li>';
-        echo '</ul>';
-
-    }
-
-    echo '</div><!-- /.navbar-collapse -->
-    </div><!-- /.container-fluid -->
-    </nav>';
-}
-
-/**
-* Add attributes to the HTTP header.
-*/
-public static function create_http_header()
-{
-   header( 'Cache-Control: no-store, no-cache, must-revalidate' );
-   header( 'Cache-Control: post-check=0, pre-check=0', false );
-   header( 'Pragma: no-cache' );
-}
-
-/**
- * Open the XML file containing the community token
- * @param $tokenFilePath
- * @throws Exception
- */
-public static function open_tokens_file($tokenFilePath)
-{
-    if (file_exists( $tokenFilePath ))
-    {
-        $tokenFile = simplexml_load_file( $tokenFilePath );
-    }
-    else
-    {
-        throw new Exception('Error: Cannot connect to tokens database!');
-    }
-
-
-    if (!$tokenFile)
-    {
-        throw new Exception('Error: Cannot open tokens database!');
-    }
-}
-
-
-/**
- * Write the new token to the XML file
- * @param $tokenId
- */
-public static function write_new_token($tokenId)
-{    // write new tokenId to tokens file
-    $tokenFile->tokenId = $tokenId;
-
-    //Format XML to save indented tree rather than one line
-    $dom = new DOMDocument('1.0');
-    $dom->preserveWhiteSpace = false;
-    $dom->formatOutput = true;
-    $dom->loadXML( $tokenFile->asXML());
-    $dom->save( $tokenFilePath );
-}
-
-
-//moved from create project view.
-
-public static function create_project()
-{
-    $project = new Project();
-    $project->owner = Session::get('username');
-    $project->name = $_POST['project-name'];
-    $project->description = $_POST['project-description'];
-
-
-    $projectId = null;
-
-    try
-    {
-        $projectId = Airavata::createProject(Config::get('pga_config.airavata')['gateway-id'], $project);
-
-        if ($projectId)
-        {
-            Utilities::print_success_message("<p>Project {$_POST['project-name']} created!</p>" .
-                '<p>You will be redirected to the summary page shortly, or you can
-                <a href="project/summary?projId=' . $projectId . '">go directly</a> to the project summary page.</p>');
-        }
-        else
-        {
-            Utilities::print_error_message("Error creating project {$_POST['project-name']}!");
-        }
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
-    }
-
-    return $projectId;
-}
-
-/**
- * Get experiments in project
- * @param $projectId
- * @return array|null
- */
-public static function get_experiments_in_project($projectId)
-{
-
-    $experiments = array();
-
-    try
-    {
-        $experiments = Airavata::getAllExperimentsInProject($projectId);
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
-    }
-    catch (TTransportException $tte)
-    {
-        Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-    }
-
-    return $experiments;
-}
-
-public static function update_project($projectId, $projectDetails)
-{
-
-    $updatedProject = new Project();
-    $updatedProject->owner = $projectDetails["owner"];
-    $updatedProject->name = $projectDetails["name"];
-    $updatedProject->description = $projectDetails["description"];
-
-    try
-    {
-        Airavata::updateProject($projectId, $updatedProject);
-
-        //Utilities::print_success_message('Project updated! Click <a href="project_summary.php?projId=' . $projectId . '">here</a> to view the project summary.');
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-    }
-    catch (ProjectNotFoundException $pnfe)
-    {
-        Utilities::print_error_message('ProjectNotFoundException!<br><br>' . $pnfe->getMessage());
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
-    }
-}
-
-
-/**
- * Create a new experiment from the values submitted in the form
- * @return null
- */
-public static function create_experiment()
-{
-
-    $experiment = Utilities::assemble_experiment();
-    $expId = null;
-
-    try
-    {
-        if($experiment)
-        {
-            $expId = Airavata::createExperiment( Session::get("gateway_id"), $experiment);
-        }
-
-        if ($expId)
-        {
-            /*
-            Utilities::print_success_message("Experiment {$_POST['experiment-name']} created!" .
-                ' <a href="experiment_summary.php?expId=' . $expId . '">Go to experiment summary page</a>');
-            */
-        }
-        else
-        {
-            Utilities::print_error_message("Error creating experiment {$_POST['experiment-name']}!");
-        }
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-    }
-    catch (AiravataSystemException $ase)
-    {
-        Utilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
-    }
-
-    return $expId;
-}
-
-/*
- * Required in Experiment Sumamry page.
- *
-*/
-
-public static function list_output_files($experiment, $expStatus)
-{   
-
-    $expStatusVal = array_search($expStatus, ExperimentState::$__names);
-
-    if($expStatusVal == ExperimentState::COMPLETED )
-    {
-        $utility = new Utilities();
-        $experimentOutputs = $experiment->experimentOutputs;
-
-        foreach ((array)$experimentOutputs as $output)
-        {   
-            if ($output->type == DataType::URI || $output->type == DataType::STDOUT || $output->type == DataType::STDERR )
-            {
-                $explode = explode('/', $output->value);
-                //echo '<p>' . $output->key .  ': <a href="' . $output->value . '">' . $output->value . '</a></p>';
-                $outputPath = str_replace(Utilities::$experimentDataPathAbsolute, Constant::EXPERIMENT_DATA_ROOT, $output->value);
-                $outputPathArray = explode("/", $outputPath);
-
-                echo '<p>' . $output->name  . ' : ' . '<a target="_blank"
-                            href="' . URL::to("/") . "/.." . str_replace(Utilities::$experimentDataPathAbsolute, Constant::EXPERIMENT_DATA_ROOT, $output->value) . '">' . 
-                        $outputPathArray[ sizeof( $outputPathArray) - 1] . ' <span class="glyphicon glyphicon-new-window"></span></a></p>';
-            }
-            elseif ($output->type == DataType::STRING)
-            {
-                echo '<p>' . $output->value . '</p>';
-            }
-        }
-    }
-    else
-        echo "Experiment hasn't completed. Experiment Status is : " . $expStatus;
-}
-
-public static function get_experiment_values( $experiment, $project, $forSearch = false)
-{
-    //var_dump( $experiment); exit;
-    $expVal = array();
-    $expVal["experimentStatusString"] = "";
-    $expVal["experimentTimeOfStateChange"] = "";
-    $expVal["experimentCreationTime"] = "";
-
-    if( $experiment->experimentStatus != null)
-    {
-        $experimentStatus = $experiment->experimentStatus;
-        $experimentState = $experimentStatus->experimentState;
-        $experimentStatusString = ExperimentState::$__names[$experimentState];
-        $expVal["experimentStatusString"] = $experimentStatusString;
-        $expVal["experimentTimeOfStateChange"] = $experimentStatus->timeOfStateChange/1000; // divide by 1000 since timeOfStateChange is in ms
-        $expVal["experimentCreationTime"] = $experiment->creationTime/1000; // divide by 1000 since creationTime is in ms
-    }
-    $jobStatus = Airavata::getJobStatuses($experiment->experimentID);
-
-    if ($jobStatus)
-    {
-        $jobName = array_keys($jobStatus);
-        $jobState = JobState::$__names[$jobStatus[$jobName[0]]->jobState];
-    }
-    else
-    {
-        $jobState = null;
-    }
-
-    $expVal["jobState"] = $jobState;
-    
-    if(! $forSearch)
-    {
-        $userConfigData = $experiment->userConfigurationData;
-        $scheduling = $userConfigData->computationalResourceScheduling;
-        $expVal['scheduling'] = $scheduling;
-        $expVal["computeResource"] = Utilities::get_compute_resource($scheduling->resourceHostId);
-    }
-    $expVal["applicationInterface"] = Utilities::get_application_interface($experiment->applicationId);
-
-
-    switch ($experimentStatusString)
-    {
-        case 'CREATED':
-        case 'VALIDATED':
-        case 'SCHEDULED':
-        case 'CANCELED':
-        case 'FAILED':
-            $expVal["editable"] = true;
-            break;
-        default:
-            $expVal["editable"] = false;
-            break;
-    }
-
-    switch ($experimentStatusString)
-    {
-        case 'CREATED':
-        case 'VALIDATED':
-        case 'SCHEDULED':
-        case 'LAUNCHED':
-        case 'EXECUTING':
-            $expVal["cancelable"] = true;
-            break;
-        default:
-            $expVal["cancelable"] = false;
-            break;
-    }
-
-    return $expVal;
-
-}
-
-    public static function get_all_user_projects_with_pagination($limit, $offset)
-    {
-
-        $projects = array();
-
-        try
-        {
-            $projects = Airavata::getAllUserProjectsWithPagination( Session::get("gateway_id"),
-                Session::get("username"), $limit, $offset);
-        }
-        catch (InvalidRequestException $ire)
-        {
-            Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-        }
-        catch (AiravataClientException $ace)
-        {
-            Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-        }
-        catch (AiravataSystemException $ase)
-        {
-            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-            {
-                Utilities::print_info_message('<p>You have not created any projects yet, so no results will be returned!</p>
-                                <p>Click <a href="create_project.php">here</a> to create a new project.</p>');
-            }
-            else
-            {
-                Utilities::print_error_message('There was a problem with Airavata. Please try again later, or report a bug using the link in the Help menu.');
-                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
-            }
-        }
-        catch (TTransportException $tte)
-        {
-            Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-        }
-
-        return $projects;
-    }
-
-
-
-    public static function get_projsearch_results_with_pagination( $searchKey, $searchValue, $limit, $offset)
-    {
-
-        $projects = array();
-
-        try
-        {
-            switch ( $searchKey)
-            {
-                case 'project-name':
-                    $projects = Airavata::searchProjectsByProjectNameWithPagination( Session::get("gateway_id"),
-                        Session::get("username"), $searchValue, $limit, $offset);
-                    break;
-                case 'project-description':
-                    $projects = $airavataclient->searchProjectsByProjectDescWithPagination( Session::get("gateway_id"),
-                        Session::get("username"), $searchValue, $limit, $offset);
-                    break;
-            }
-        }
-        catch (InvalidRequestException $ire)
-        {
-            Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-        }
-        catch (AiravataClientException $ace)
-        {
-            Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-        }
-        catch (AiravataSystemException $ase)
-        {
-            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-            {
-                Utilities::print_info_message('<p>You have not created any projects yet, so no results will be returned!</p>
-                                <p>Click <a href="create_project.php">here</a> to create a new project.</p>');
-            }
-            else
-            {
-                Utilities::print_error_message('There was a problem with Airavata. Please try again later, or report a bug using the link in the Help menu.');
-                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
-            }
-        }
-        catch (TTransportException $tte)
-        {
-            Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-        }
-
-        return $projects;
-    }
-
-
-public static function get_projsearch_results( $searchKey, $searchValue)
-{
-
-    $projects = array();
-
-    try
-    {
-        switch ( $searchKey)
-        {
-            case 'project-name':
-                $projects = Airavata::searchProjectsByProjectName( Session::get("gateway_id"), Session::get("username"), $searchValue);
-                break;
-            case 'project-description':
-                $projects = $airavataclient->searchProjectsByProjectDesc( Session::get("gateway_id"), Session::get("username"), $searchValue);
-                break;
-        }
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-    }
-    catch (AiravataSystemException $ase)
-    {
-        if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-        {
-            Utilities::print_info_message('<p>You have not created any projects yet, so no results will be returned!</p>
-                                <p>Click <a href="create_project.php">here</a> to create a new project.</p>');
-        }
-        else
-        {
-            Utilities::print_error_message('There was a problem with Airavata. Please try again later, or report a bug using the link in the Help menu.');
-            //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
-        }
-    }
-    catch (TTransportException $tte)
-    {
-        Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-    }
-
-    return $projects;
-}
-
-
-/**
- * Create options for the search key select input
- * @param $values
- * @param $labels
- * @param $disabled
- */
-public static function create_options($values, $labels, $disabled)
-{
-    for ($i = 0; $i < sizeof($values); $i++)
-    {
-        $selected = '';
-
-        // if option was previously selected, mark it as selected
-        if (isset($_POST['search-key']))
-        {
-            if ($values[$i] == $_POST['search-key'])
-            {
-                $selected = 'selected';
-            }
-        }
-
-        echo '<option value="' . $values[$i] . '" ' . $disabled[$i] . ' ' . $selected . '>' . $labels[$i] . '</option>';
-    }
-}
-
-    /**
-     * Get results of the user's search of experiments with pagination
-     * @return array|null
-     */
-    public static function get_expsearch_results_with_pagination( $inputs, $limit, $offset)
-    {
-        $experiments = array();
-
-        try
-        {
-            $filters = array();
-            if($inputs["status-type"] != "ALL"){
-                $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::STATUS] = $inputs["status-type"];
-            }
-            switch ( $inputs["search-key"])
-            {
-                case 'experiment-name':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_NAME] = $inputs["search-value"];
-                    break;
-                case 'experiment-description':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::EXPERIMENT_DESC] = $inputs["search-value"];
-                    break;
-                case 'application':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::APPLICATION_ID] = $inputs["search-value"];
-                    break;
-                case 'creation-time':
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::FROM_DATE] = strtotime( $inputs["from-date"])*1000;
-                    $filters[\Airavata\Model\Workspace\Experiment\ExperimentSearchFields::TO_DATE] = strtotime( $inputs["to-date"])*1000;
-                    break;
-                case '':
-            }
-            $experiments = Airavata::searchExperiments(
-                Session::get('gateway_id'), Session::get('username'), $filters, $limit, $offset);
-        }
-        catch (InvalidRequestException $ire)
-        {
-            Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-        }
-        catch (AiravataClientException $ace)
-        {
-            Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-        }
-        catch (AiravataSystemException $ase)
-        {
-            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-            {
-                Utilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
-                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
-                                <a href="create_project.php">here</a> to create a new project.</p>');
-            }
-            else
-            {
-                Utilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
-                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
-            }
-        }
-        catch (TTransportException $tte)
-        {
-            Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-        }
-
-        //get values of all experiments
-        $expContainer = array();
-        $expNum = 0;
-        foreach( $experiments as $experiment)
-        {
-            $expValue = Utilities::get_experiment_values( $experiment, Utilities::get_project($experiment->projectID), true );
-            $expContainer[$expNum]['experiment'] = $experiment;
-            if( $expValue["experimentStatusString"] == "FAILED")
-                $expValue["editable"] = false;
-            $expContainer[$expNum]['expValue'] = $expValue;
-            $expNum++;
-        }
-
-        return $expContainer;
-    }
-
-    /**
- * Get results of the user's search of experiments
- * @return array|null
- */
-public static function get_expsearch_results( $inputs)
-{
-    $experiments = array();
-
-    try
-    {
-        switch ( $inputs["search-key"])
-        {
-            case 'experiment-name':
-                $experiments = Airavata::searchExperimentsByName(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
-                break;
-            case 'experiment-description':
-                $experiments = Airavata::searchExperimentsByDesc(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
-                break;
-            case 'application':
-                $experiments = Airavata::searchExperimentsByApplication(Session::get('gateway_id'), Session::get('username'), $inputs["search-value"]);
-                break;
-            case 'creation-time':
-                $experiments = Airavata::searchExperimentsByCreationTime(Session::get('gateway_id'), Session::get('username'), strtotime( $inputs["from-date"])*1000, strtotime( $inputs["to-date"])*1000 );
-                break;
-            case '':
-        }
-    }
-    catch (InvalidRequestException $ire)
-    {
-        Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-    }
-    catch (AiravataClientException $ace)
-    {
-        Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-    }
-    catch (AiravataSystemException $ase)
-    {
-        if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-        {
-            Utilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
-                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
-                                <a href="create_project.php">here</a> to create a new project.</p>');
-        }
-        else
-        {
-            Utilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
-            //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
-        }
-    }
-    catch (TTransportException $tte)
-    {
-        Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-    }
-
-    //get values of all experiments
-    $expContainer = array();
-    $expNum = 0;
-    foreach( $experiments as $experiment)
-    {
-        $expValue = Utilities::get_experiment_values( $experiment, Utilities::get_project($experiment->projectID), true );
-        $expContainer[$expNum]['experiment'] = $experiment;
-        if( $expValue["experimentStatusString"] == "FAILED")
-            $expValue["editable"] = false;
-        $expContainer[$expNum]['expValue'] = $expValue;
-        $expNum++;
-    }
-
-    return $expContainer;
-}
-
-    /**
-     * Get results of the user's all experiments with pagination.
-     * Results are ordered creation time DESC
-     * @return array|null
-     */
-    public static function get_all_user_experiments_with_pagination($limit, $offset)
-    {
-        $experiments = array();
-
-        try
-        {
-            $experiments = Airavata::getAllUserExperimentsWithPagination(
-                Session::get('gateway_id'), Session::get('username'), $limit, $offset
-            );
-        }
-        catch (InvalidRequestException $ire)
-        {
-            Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
-        }
-        catch (AiravataClientException $ace)
-        {
-            Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
-        }
-        catch (AiravataSystemException $ase)
-        {
-            if ($ase->airavataErrorType == 2) // 2 = INTERNAL_ERROR
-            {
-                Utilities::print_info_message('<p>You have not created any experiments yet, so no results will be returned!</p>
-                                <p>Click <a href="create_experiment.php">here</a> to create an experiment, or
-                                <a href="create_project.php">here</a> to create a new project.</p>');
-            }
-            else
-            {
-                Utilities::print_error_message('There was a problem with Airavata. Please try again later or report a bug using the link in the Help menu.');
-                //print_error_message('AiravataSystemException!<br><br>' . $ase->airavataErrorType . ': ' . $ase->getMessage());
-            }
-        }
-        catch (TTransportException $tte)
-        {
-            Utilities::print_error_message('TTransportException!<br><br>' . $tte->getMessage());
-        }
-
-        //get values of all experiments
-        $expContainer = array();
-        $expNum = 0;
-        foreach( $experiments as $experiment)
-        {
-            $expValue = Utilities::get_experiment_values( $experiment, Utilities::get_project($experiment->projectID), true );
-            $expContainer[$expNum]['experiment'] = $experiment;
-            if( $expValue["experimentStatusString"] == "FAILED")
-                $expValue["editable"] = false;
-            $expContainer[$expNum]['expValue'] = $expValue;
-            $expNum++;
-        }
-
-        return $expContainer;
-    }
-
-public static function getExpStates(){
-    return ExperimentState::$__names;
-}
-
-
-public static function apply_changes_to_experiment($experiment, $input)
-{
-    $experiment->name = $input['experiment-name'];
-    $experiment->description = rtrim($input['experiment-description']);
-    $experiment->projectID = $input['project'];
-    //$experiment->applicationId = $_POST['application'];
-
-    $userConfigDataUpdated = $experiment->userConfigurationData;
-    $schedulingUpdated = $userConfigDataUpdated->computationalResourceScheduling;
-
-    $schedulingUpdated->resourceHostId = $input['compute-resource'];
-    $schedulingUpdated->nodeCount = $input['node-count'];
-    $schedulingUpdated->queueName = $_POST['queue-name'];
-    $schedulingUpdated->totalCPUCount = $input['cpu-count'];
-    //$schedulingUpdated->numberOfThreads = $input['threads'];
-    $schedulingUpdated->wallTimeLimit = $input['wall-time'];
-    //$schedulingUpdated->totalPhysicalMemory = $input['memory'];
-
-    /*
-    switch ($_POST['compute-resource'])
-    {
-        case 'trestles.sdsc.edu':
-            $schedulingUpdated->ComputationalProjectAccount = 'sds128';
-            break;
-        case 'stampede.tacc.xsede.org':
-        case 'lonestar.tacc.utexas.edu':
-            $schedulingUpdated->ComputationalProjectAccount = 'TG-STA110014S';
-            break;
-        default:
-            $schedulingUpdated->ComputationalProjectAccount = 'admin';
-    }
-    */
-
-    $userConfigDataUpdated->computationalResourceScheduling = $schedulingUpdated;
-    if( isset( $input["userDN"]) )
-    {
-        $userConfigDataUpdated->generateCert = 1;
-        $userConfigDataUpdated->userDN = $input["userDN"];
-    }
-
-    $experiment->userConfigurationData = $userConfigDataUpdated;
-
-    $applicationInputs = Utilities::get_application_inputs($experiment->applicationId);
-
-    $experimentInputs = $experiment->experimentInputs; // get current inputs
-    //var_dump($experimentInputs);
-    $experimentInputs = Utilities::process_inputs($applicationInputs, $experimentInputs); // get new inputs
-    //var_dump($experimentInputs);
-
-    if ($experimentInputs)
-    {
-        $experiment->experimentInputs = $experimentInputs;
-        //var_dump($experiment);
-        return $experiment;
-    }
-}
-
-public static function get_job_details( $experimentId){
-    return Airavata::getJobDetails( $experimentId);
-}
-
-public static function get_transfer_details( $experimentId){
-    return Airavata::getDataTransferDetails( $experimentId);
-}
-
-public static function getQueueDatafromResourceId( $crId){
-    $resourceObject = Airavata::getComputeResource( $crId);
-    return $resourceObject->batchQueues;
-}
-
-}
-
-?>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/models/Constant.php
----------------------------------------------------------------------
diff --git a/app/models/Constant.php b/app/models/Constant.php
deleted file mode 100644
index f18ba41..0000000
--- a/app/models/Constant.php
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-
-class Constant extends Eloquent{
-
-
-	const EXPERIMENT_DATA_ROOT = '/../experimentData/';
-
-	/* 
-
-	------------ now rest all are handled at config/app-config.ini -------------------
-
-	const AIRAVATA_SERVER = 'gw111.iu.xsede.org';
-	//const AIRAVATA_SERVER = 'gw127.iu.xsede.org';
-	//const AIRAVATA_SERVER = 'gw56.iu.xsede.org'; //Mirror
-	//const AIRAVATA_PORT = 8930; //development
-	const AIRAVATA_PORT = 9930; //production
-	const AIRAVATA_TIMEOUT = 100000;
-	const EXPERIMENT_DATA_ROOT = '/../experimentData/';
-
-	const SSH_USER = 'root';
-	//const DATA_PATH = 'file://home/pga/production/experimentData/';
-
-	const EXPERIMENT_DATA_ROOT_ABSOLUTE = '/var/www/experimentData/';
-	//const EXPERIMENT_DATA_ROOT_ABSOLUTE = 'C:/wamp/www/experimentData/';
-
-	//const USER_STORE = 'WSO2','XML','USER_API';
-	const USER_STORE = 'WSO2';
-
-	//This will need to be updated everytime a new user role is being added for
-	//specific purposes.
-	const ADMIN_ROLE = "admin";
-	const GATEWAY_ADMIN_ROLE = "gateway_admin";
-	const USER_ROLE = "Internal/everyone";
-
-	//identity server roles assigned for Gateway
-	const GATEWAY_ROLE_PREPEND = "gateway_";
-	const GATEWAY_ROLE_ADMIN_APPEND = "_admin";
-
-	const REQ_URL = 'https://gw111.iu.xsede.org:8443/credential-store/acs-start-servlet';
-	const GATEWAY_NAME = 'PHP-Reference-Gateway';
-	const EMAIL = 'admin@gw120.iu.xsede.org';	
-
-	const SERVER_ALLOWED_FILE_SIZE = 64; // in MB
-
-	*/ 
-}
-
-?>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/models/User.php
----------------------------------------------------------------------
diff --git a/app/models/User.php b/app/models/User.php
deleted file mode 100755
index 0d96f81..0000000
--- a/app/models/User.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-
-use Illuminate\Auth\UserTrait;
-use Illuminate\Auth\UserInterface;
-use Illuminate\Auth\Reminders\RemindableTrait;
-use Illuminate\Auth\Reminders\RemindableInterface;
-
-class User extends Eloquent implements UserInterface, RemindableInterface {
-
-	use UserTrait, RemindableTrait;
-
-	/**
-	 * The database table used by the model.
-	 *
-	 * @var string
-	 */
-	protected $table = 'users';
-
-	/**
-	 * The attributes excluded from the model's JSON form.
-	 *
-	 * @var array
-	 */
-	protected $hidden = array('password', 'remember_token');
-}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 1c56f88..7104b5e 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -28,8 +28,8 @@ Route::get("logout", "AccountController@logout");
 
 Route::get("forgot-password", "AccountController@forgotPassword");
 
-Route::get("setUserTimezone", function(){
-	Session::set("user_timezone", Input::get("timezone"));
+Route::get("setUserTimezone", function () {
+    Session::set("user_timezone", Input::get("timezone"));
 });
 /*
  * The following routes will not work without logging in.
@@ -89,17 +89,17 @@ Route::post("experiment/browse", "ExperimentController@browseView");
  * Compute Resources Routes
 */
 
-Route::get("cr/create", function(){
-	return Redirect::to("cr/create/step1");
+Route::get("cr/create", function () {
+    return Redirect::to("cr/create/step1");
 });
 
-Route::get("cr/create", "ComputeResource@createView"); 
+Route::get("cr/create", "ComputeResource@createView");
 
 Route::post("cr/create", "ComputeResource@createSubmit");
 
-Route::get("cr/edit", "ComputeResource@editView"); 
+Route::get("cr/edit", "ComputeResource@editView");
 
-Route::post("cr/edit", "ComputeResource@editSubmit"); 
+Route::post("cr/edit", "ComputeResource@editSubmit");
 
 Route::get("cr/browse", "ComputeResource@browseView");
 
@@ -168,8 +168,8 @@ Route::get("admin/dashboard/experiments", "AdminController@experimentsView");
 
 Route::get("admin/dashboard/resources", "AdminController@resourcesView");
 
-Route::get("admin/dashboard/experiment/summary", function(){
-	return Redirect::to("experiment/summary?expId=" . $_GET["expId"] . "&dashboard=true");
+Route::get("admin/dashboard/experiment/summary", function () {
+    return Redirect::to("experiment/summary?expId=" . $_GET["expId"] . "&dashboard=true");
 });
 
 Route::get("admin/dashboard/credential-store", "AdminController@credentialStoreView");
@@ -194,15 +194,15 @@ Route::post("admin/add-gateway", "AdminController@addGateway");
 Route::get("admin/add-gateway", "AdminController@addGateway");
 
 //Airavata Server Check
-Route::get("airavata/down", function(){
-	return View::make("server-down");
+Route::get("airavata/down", function () {
+    return View::make("server-down");
 });
 /*
  * Test Routes.
 */
 
-Route::get("testjob", function(){
-	//print_r( Session::all());
+Route::get("testjob", function () {
+    //print_r( Session::all());
 });
 
 

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/account/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/create.blade.php b/app/views/account/create.blade.php
index 9feb720..7d92a7f 100755
--- a/app/views/account/create.blade.php
+++ b/app/views/account/create.blade.php
@@ -1,7 +1,7 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
@@ -15,25 +15,26 @@
         </h3>
     </div>
     @if ($errors->has())
-        
-            @foreach ($errors->all() as $error)
-                {{ Utilities::print_error_message($error) }}        
-            @endforeach
-        
-        @endif
 
-    <form action="create" method="post" role="form">
-        
-    @if( Session::has('username_exists'))
-            {{ Utilities::print_error_message('The username you entered is already in use. Please select another.') }}
+    @foreach ($errors->all() as $error)
+    {{ Utilities::print_error_message($error) }}
+    @endforeach
+
     @endif
-    <?php
-    Session::forget("username_exists");
-    ?>
+
+    <form action="create" method="post" role="form">
+
+        @if( Session::has('username_exists'))
+        {{ Utilities::print_error_message('The username you entered is already in use. Please select another.') }}
+        @endif
+        <?php
+        Session::forget("username_exists");
+        ?>
         <div class="form-group required"><label class="control-label">Username</label>
 
             <div><input class="form-control" id="username" minlength="6" maxlength="30" name="username"
-                        placeholder="Username" required="required" type="text"  value="{{Input::old('username') }}"/></div>
+                        placeholder="Username" required="required" type="text" value="{{Input::old('username') }}"/>
+            </div>
         </div>
         <div class="form-group required"><label class="control-label">Password</label>
 
@@ -49,58 +50,60 @@
         <div class="form-group required"><label class="control-label">E-mail</label>
 
             <div><input class="form-control" id="email" name="email" placeholder="E-mail"
-                        required="required" title="" type="email"   value="{{Input::old('email') }}"/></div>
+                        required="required" title="" type="email" value="{{Input::old('email') }}"/></div>
         </div>
         <div class="form-group required"><label class="control-label">First Name</label>
 
             <div><input class="form-control" id="first_name" maxlength="30" name="first_name"
-                        placeholder="First Name" required="required" title="" type="text"   value="{{Input::old('first_name') }}"/></div>
+                        placeholder="First Name" required="required" title="" type="text"
+                        value="{{Input::old('first_name') }}"/></div>
         </div>
         <div class="form-group required"><label class="control-label">Last Name</label>
 
             <div><input class="form-control" id="last_name" maxlength="30" name="last_name"
-                        placeholder="Last Name" required="required" title="" type="text"   value="{{Input::old('last_name') }}"/></div>
+                        placeholder="Last Name" required="required" title="" type="text"
+                        value="{{Input::old('last_name') }}"/></div>
         </div>
         <div class="form-group"><label class="control-label">Organization</label>
 
             <div><input class="form-control" id="organization" name="organization"
-                        placeholder="Organization" title="" type="text"   value="{{Input::old('organization') }}"/>
+                        placeholder="Organization" title="" type="text" value="{{Input::old('organization') }}"/>
             </div>
         </div>
         <div class="form-group"><label class="control-label">Address</label>
 
             <div><input class="form-control" id="address" name="address"
-                        placeholder="Address" title="" type="text"   value="{{Input::old('address') }}"/>
+                        placeholder="Address" title="" type="text" value="{{Input::old('address') }}"/>
             </div>
         </div>
         <div class="form-group"><label class="control-label">Country</label>
 
             <div><input class="form-control" id="country" name="country"
-                        placeholder="Country" title="" type="text"   value="{{Input::old('country') }}"/>
+                        placeholder="Country" title="" type="text" value="{{Input::old('country') }}"/>
             </div>
         </div>
         <div class="form-group"><label class="control-label">Telephone</label>
 
             <div><input class="form-control" id="telephone" name="telephone"
-                        placeholder="Telephone" title="" type="tel"   value="{{Input::old('telephone') }}"/>
+                        placeholder="Telephone" title="" type="tel" value="{{Input::old('telephone') }}"/>
             </div>
         </div>
         <div class="form-group"><label class="control-label">Mobile</label>
 
             <div><input class="form-control" id="mobile" name="mobile"
-                        placeholder="Mobile" title="" type="tel"   value="{{Input::old('mobile') }}"/>
+                        placeholder="Mobile" title="" type="tel" value="{{Input::old('mobile') }}"/>
             </div>
         </div>
         <div class="form-group"><label class="control-label">IM</label>
 
             <div><input class="form-control" id="im" name="im"
-                        placeholder="IM" title="" type="text"   value="{{Input::old('im') }}"/>
+                        placeholder="IM" title="" type="text" value="{{Input::old('im') }}"/>
             </div>
         </div>
         <div class="form-group"><label class="control-label">URL</label>
 
             <div><input class="form-control" id="url" name="url"
-                        placeholder="URL" title="" type="text"   value="{{Input::old('url') }}"/>
+                        placeholder="URL" title="" type="text" value="{{Input::old('url') }}"/>
             </div>
         </div>
         <br/>


[05/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-experiments.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-experiments.blade.php b/app/views/admin/manage-experiments.blade.php
index dc5d405..eb97fba 100644
--- a/app/views/admin/manage-experiments.blade.php
+++ b/app/views/admin/manage-experiments.blade.php
@@ -1,408 +1,478 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}    
-    {{ HTML::style('css/datetimepicker.css')}}            
+@parent
+{{ HTML::style('css/admin.css')}}
+{{ HTML::style('css/datetimepicker.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-            @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-            <div class="col-md-12">
-                <h3>Experiments</h3>
+<div id="wrapper">
+<!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+@include( 'partials/dashboard-block')
+<div id="page-wrapper">
+<div class="col-md-12">
+    <h3>Experiments</h3>
+</div>
+<div class="container-fluid">
+
+<div class="row">
+    <!--
+        <div class="well col-md-2 text-center">
+            Total 500
+        </div>
+    -->
+
+    <div class="well form-group form-horizontal col-md-12">
+        <label class="col-md-3">Enter Experiment Id to View Summary :</label>
+
+        <div class="col-md-6">
+            <input type="text" class="form-control experimentId"/>
+        </div>
+        <button class="col-md-3 btn btn-primary get-experiment">Get</button>
+        <div class="loading-img hide text-center"><img src="{{URL::to('/')}}/assets/ajax-loader.gif"/></div>
+
+        <div class="experiment-info col-md-12">
+        </div>
+    </div>
+</div>
+
+<div class="dates row">
+    <h1 class="text-center well alert alert-danger">UI beyond this message is under construction view with dummy
+        values.</h1>
+
+    <div class="col-md-12">
+        Select dates between which you want to review experiments.
+    </div>
+    <div class="col-sm-8" style="height:75px;">
+        <div class='col-md-6'>
+            <div class="form-group">
+                <div class='input-group date' id='datetimepicker9'>
+                    <input type='text' class="form-control" placeholder="From Date" name="from-date"
+                           value="<?php if (isset($_POST['from-date'])) echo $_POST['from-date'] ?>"/>
+                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
+                                    </span>
+                </div>
+            </div>
+        </div>
+        <div class='col-md-6'>
+            <div class="form-group">
+                <div class='input-group date' id='datetimepicker10'>
+                    <input type='text' class="form-control" placeholder="To Date" name="to-date"
+                           value="<?php if (isset($_POST['to-date'])) echo $_POST['to-date'] ?>"/>
+                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
+                                    </span>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<!-- high level statistics -->
+<div class="high-level-values row tex-center">
+    <div class="col-lg-3 col-md-6">
+        <div class="panel panel-primary">
+            <div class="panel-heading">
+                <div class="row">
+                    <div class="col-xs-3">
+                        <i class="fa fa-comments fa-5x"></i>
+                    </div>
+                    <div class="col-xs-9 text-right">
+                        <div class="huge">26</div>
+                        <div>Total Experiments</div>
+                    </div>
+                </div>
             </div>
-            <div class="container-fluid">
+            <a href="#">
+                <div class="panel-footer">
+                    <span class="pull-left">View Details</span>
+                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></span>
+
+                    <div class="clearfix"></div>
+                </div>
+            </a>
+        </div>
+    </div>
 
+    <div class="col-lg-3 col-md-6">
+        <div class="panel panel-green">
+            <div class="panel-heading">
                 <div class="row">
-                    <!--
-                        <div class="well col-md-2 text-center">
-                            Total 500
-                        </div>
-                    -->
+                    <div class="col-xs-3">
+                        <i class="fa fa-comments fa-5x"></i>
+                    </div>
+                    <div class="col-xs-9 text-right">
+                        <div class="huge">16</div>
+                        <div>Successful Experiments</div>
+                    </div>
+                </div>
+            </div>
+            <a href="#">
+                <div class="panel-footer">
+                    <span class="pull-left">View Details</span>
+                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></i></span>
 
-                    <div class="well form-group form-horizontal col-md-12">
-                        <label class="col-md-3">Enter Experiment Id to View Summary :</label>
-                        <div class="col-md-6">
-                            <input type="text" class="form-control experimentId"/>
-                        </div>
-                        <button class="col-md-3 btn btn-primary get-experiment">Get</button>
-                        <div class="loading-img hide text-center"><img src="{{URL::to('/')}}/assets/ajax-loader.gif"/></div>
+                    <div class="clearfix"></div>
+                </div>
+            </a>
+        </div>
+    </div>
 
-                        <div class="experiment-info col-md-12">
-                        </div>
+    <div class="col-lg-3 col-md-6">
+        <div class="panel panel-yellow">
+            <div class="panel-heading">
+                <div class="row">
+                    <div class="col-xs-3">
+                        <i class="fa fa-comments fa-5x"></i>
                     </div>
+                    <div class="col-xs-9 text-right">
+                        <div class="huge">10</div>
+                        <div>Canceled Experiments</div>
+                    </div>
+                </div>
+            </div>
+            <a href="#">
+                <div class="panel-footer">
+                    <span class="pull-left">View Details</span>
+                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></i></span>
+
+                    <div class="clearfix"></div>
                 </div>
+            </a>
+        </div>
+    </div>
 
-                <div class="dates row">
-                    <h1 class="text-center well alert alert-danger" >UI beyond this message is under construction view with dummy values.</h1>
-                    <div class="col-md-12">
-                    Select dates between which you want to review experiments.
+    <div class="col-lg-3 col-md-6">
+        <div class="panel panel-red">
+            <div class="panel-heading">
+                <div class="row">
+                    <div class="col-xs-3">
+                        <i class="fa fa-comments fa-5x"></i>
                     </div>
-                    <div class="col-sm-8" style="height:75px;">
-                       <div class='col-md-6'>
-                            <div class="form-group">
-                                <div class='input-group date' id='datetimepicker9'>
-                                    <input type='text' class="form-control" placeholder="From Date" name="from-date" value="<?php if (isset($_POST['from-date'])) echo $_POST['from-date'] ?>"/>
-                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
-                                    </span>
-                                </div>
-                            </div>
-                        </div>
-                        <div class='col-md-6'>
-                            <div class="form-group">
-                                <div class='input-group date' id='datetimepicker10'>
-                                    <input type='text' class="form-control"  placeholder="To Date" name="to-date" value="<?php if (isset($_POST['to-date'])) echo $_POST['to-date'] ?>"/>
-                                    <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
-                                    </span>
-                                </div>
-                            </div>
-                        </div>
+                    <div class="col-xs-9 text-right">
+                        <div class="huge">6</div>
+                        <div>Failed Experiments</div>
                     </div>
                 </div>
-                <!-- high level statistics -->
-                <div class="high-level-values row tex-center">
-                    <div class="col-lg-3 col-md-6">
-                        <div class="panel panel-primary">
-                            <div class="panel-heading">
-                                <div class="row">
-                                    <div class="col-xs-3">
-                                        <i class="fa fa-comments fa-5x"></i>
-                                    </div>
-                                    <div class="col-xs-9 text-right">
-                                        <div class="huge">26</div>
-                                        <div>Total Experiments</div>
-                                    </div>
+            </div>
+            <a href="#">
+                <div class="panel-footer">
+                    <span class="pull-left">View Details</span>
+                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></span>
+
+                    <div class="clearfix"></div>
+                </div>
+            </a>
+        </div>
+    </div>
+</div>
+
+<div class="row">
+    <div class="col-lg-12">
+        <div class="panel panel-primary">
+            <div class="panel-heading">
+                <h3 class="panel-title"><i class="fa fa-bar-chart-o"></i>Experiment v/s Time Graph</h3>
+            </div>
+            <div class="panel-body">
+                <div class="flot-chart">
+                    <div class="flot-chart-content" id="flot-line-chart" style="padding: 0px; position: relative;">
+                        <canvas class="base" width="1596" height="400"></canvas>
+                        <canvas class="overlay" width="1596" height="400"
+                                style="position: absolute; left: 0px; top: 0px;"></canvas>
+                        <div class="tickLabels" style="font-size:smaller">
+                            <div class="xAxis x1Axis" style="color:#545454">
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:-33px;top:383px;width:122px">0
                                 </div>
-                            </div>
-                            <a href="#">
-                                <div class="panel-footer">
-                                    <span class="pull-left">View Details</span>
-                                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></span>
-                                    <div class="clearfix"></div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:97px;top:383px;width:122px">1
                                 </div>
-                            </a>
-                        </div>
-                    </div>
-
-                    <div class="col-lg-3 col-md-6">
-                        <div class="panel panel-green">
-                            <div class="panel-heading">
-                                <div class="row">
-                                    <div class="col-xs-3">
-                                        <i class="fa fa-comments fa-5x"></i>
-                                    </div>
-                                    <div class="col-xs-9 text-right">
-                                        <div class="huge">16</div>
-                                        <div>Successful Experiments</div>
-                                    </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:228px;top:383px;width:122px">2
                                 </div>
-                            </div>
-                            <a href="#">
-                                <div class="panel-footer">
-                                    <span class="pull-left">View Details</span>
-                                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></i></span>
-                                    <div class="clearfix"></div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:358px;top:383px;width:122px">3
                                 </div>
-                            </a>
-                        </div>
-                    </div>
-
-                    <div class="col-lg-3 col-md-6">
-                        <div class="panel panel-yellow">
-                            <div class="panel-heading">
-                                <div class="row">
-                                    <div class="col-xs-3">
-                                        <i class="fa fa-comments fa-5x"></i>
-                                    </div>
-                                    <div class="col-xs-9 text-right">
-                                        <div class="huge">10</div>
-                                        <div>Canceled Experiments</div>
-                                    </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:488px;top:383px;width:122px">4
                                 </div>
-                            </div>
-                            <a href="#">
-                                <div class="panel-footer">
-                                    <span class="pull-left">View Details</span>
-                                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></i></span>
-                                    <div class="clearfix"></div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:619px;top:383px;width:122px">5
                                 </div>
-                            </a>
-                        </div>
-                    </div>
-
-                    <div class="col-lg-3 col-md-6">
-                        <div class="panel panel-red">
-                            <div class="panel-heading">
-                                <div class="row">
-                                    <div class="col-xs-3">
-                                        <i class="fa fa-comments fa-5x"></i>
-                                    </div>
-                                    <div class="col-xs-9 text-right">
-                                        <div class="huge">6</div>
-                                        <div>Failed Experiments</div>
-                                    </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:749px;top:383px;width:122px">6
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:879px;top:383px;width:122px">7
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:1010px;top:383px;width:122px">8
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:1140px;top:383px;width:122px">9
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:1270px;top:383px;width:122px">10
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:center;left:1401px;top:383px;width:122px">11
                                 </div>
                             </div>
-                            <a href="#">
-                                <div class="panel-footer">
-                                    <span class="pull-left">View Details</span>
-                                    <span class="pull-right"><span class="glyphicon glyphicon-arrow-right"></span></span>
-                                    <div class="clearfix"></div>
+                            <div class="yAxis y1Axis" style="color:#545454">
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:right;top:337px;right:1575px;width:21px">-1.0
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:right;top:259px;right:1575px;width:21px">-0.5
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:right;top:182px;right:1575px;width:21px">0.0
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:right;top:104px;right:1575px;width:21px">0.5
+                                </div>
+                                <div class="tickLabel"
+                                     style="position:absolute;text-align:right;top:26px;right:1575px;width:21px">1.0
                                 </div>
-                            </a>
-                        </div>
-                    </div>
-                </div>
-
-                <div class="row">
-                    <div class="col-lg-12">
-                        <div class="panel panel-primary">
-                            <div class="panel-heading">
-                                <h3 class="panel-title"><i class="fa fa-bar-chart-o"></i>Experiment v/s Time Graph</h3>
                             </div>
-                            <div class="panel-body">
-                                <div class="flot-chart">
-                                    <div class="flot-chart-content" id="flot-line-chart" style="padding: 0px; position: relative;">
-                                        <canvas class="base" width="1596" height="400"></canvas>
-                                        <canvas class="overlay" width="1596" height="400" style="position: absolute; left: 0px; top: 0px;"></canvas>
-                                        <div class="tickLabels" style="font-size:smaller">
-                                            <div class="xAxis x1Axis" style="color:#545454">
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:-33px;top:383px;width:122px">0</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:97px;top:383px;width:122px">1</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:228px;top:383px;width:122px">2</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:358px;top:383px;width:122px">3</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:488px;top:383px;width:122px">4</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:619px;top:383px;width:122px">5</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:749px;top:383px;width:122px">6</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:879px;top:383px;width:122px">7</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:1010px;top:383px;width:122px">8</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:1140px;top:383px;width:122px">9</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:1270px;top:383px;width:122px">10</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:center;left:1401px;top:383px;width:122px">11</div>
-                                            </div>
-                                            <div class="yAxis y1Axis" style="color:#545454">
-                                                <div class="tickLabel" style="position:absolute;text-align:right;top:337px;right:1575px;width:21px">-1.0</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:right;top:259px;right:1575px;width:21px">-0.5</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:right;top:182px;right:1575px;width:21px">0.0</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:right;top:104px;right:1575px;width:21px">0.5</div>
-                                                <div class="tickLabel" style="position:absolute;text-align:right;top:26px;right:1575px;width:21px">1.0</div>
-                                            </div>
+                        </div>
+                        <div class="legend">
+                            <div
+                                style="position: absolute; width: 45px; height: 34px; top: 9px; right: 9px; opacity: 0.85; background-color: rgb(255, 255, 255);"></div>
+                            <table style="position:absolute;top:9px;right:9px;;font-size:smaller;color:#545454">
+                                <tbody>
+                                <tr>
+                                    <td class="legendColorBox">
+                                        <div style="border:1px solid #ccc;padding:1px">
+                                            <div
+                                                style="width:4px;height:0;border:5px solid rgb(237,194,64);overflow:hidden"></div>
                                         </div>
-                                        <div class="legend">
-                                            <div style="position: absolute; width: 45px; height: 34px; top: 9px; right: 9px; opacity: 0.85; background-color: rgb(255, 255, 255);"> </div>
-                                            <table style="position:absolute;top:9px;right:9px;;font-size:smaller;color:#545454">
-                                                <tbody>
-                                                    <tr>
-                                                        <td class="legendColorBox">
-                                                            <div style="border:1px solid #ccc;padding:1px">
-                                                                <div style="width:4px;height:0;border:5px solid rgb(237,194,64);overflow:hidden"></div>
-                                                            </div>
-                                                        </td>
-                                                        <td class="legendLabel">Canceled Experiments</td>
-                                                    </tr>
-                                                    <tr>
-                                                        <td class="legendColorBox">
-                                                            <div style="border:1px solid #ccc;padding:1px"><div style="width:4px;height:0;border:5px solid rgb(175,216,248);overflow:hidden"></div></div>
-                                                        </td>
-                                                        <td class="legendLabel">Successful Experiments</td>
-                                                    </tr>
-                                                </tbody>
-                                            </table>
+                                    </td>
+                                    <td class="legendLabel">Canceled Experiments</td>
+                                </tr>
+                                <tr>
+                                    <td class="legendColorBox">
+                                        <div style="border:1px solid #ccc;padding:1px">
+                                            <div
+                                                style="width:4px;height:0;border:5px solid rgb(175,216,248);overflow:hidden"></div>
                                         </div>
-                                    </div>
-
-
-                                </div>
-                            </div>
+                                    </td>
+                                    <td class="legendLabel">Successful Experiments</td>
+                                </tr>
+                                </tbody>
+                            </table>
                         </div>
                     </div>
-                </div>
 
-                <div class="row">
-                    <h1 class="text-center well alert alert-danger" >Proposed UI to view flow of one experiment.</h1>
-                    <div class="tree">
+
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="row">
+    <h1 class="text-center well alert alert-danger">Proposed UI to view flow of one experiment.</h1>
+
+    <div class="tree">
+        <ul>
+            <li>
+                <span><i class="icon-calendar"></i>Experiment 1</span>
+                <ul>
+                    <li>
+                        <span class="badge badge-success"><i class="icon-minus-sign"></i>Pre Processing</span>
                         <ul>
                             <li>
-                                <span><i class="icon-calendar"></i>Experiment 1</span>
-                                <ul>
-                                    <li>
-                                        <span class="badge badge-success"><i class="icon-minus-sign"></i>Pre Processing</span>
-                                        <ul>
-                                            <li>
-                                                <a href=""><span class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;  PGA to Airavata Authentication Successful</a>
-                                            </li>
-                                            <li>
-                                                <a href=""><span class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;  Airavata to Resource Authentication Successful</a>
-                                            </li>
-                                        </ul>
-                                    </li>
-                                    <li>
-                                        <span class="badge badge-success"><i class="icon-minus-sign"></i>Input Staging</span>
-                                        <ul>
-                                            <li>
-                                                <span  class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; <a href="">PGA to Airavata File Transfer Successful</a>
-                                            </li>
-                                            <li>
-                                                <span  class="alert alert-success"abhi ><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; <a href="">Airavata to Resource File Transfer Successful</a>
-                                            </li>
-                                        </ul>
-                                    </li>
-                                    <li>
-                                        <span class="badge badge-warning"><i class="icon-minus-sign"></i>Job Description</span>
-                                        <ul>
-                                            <li>
-                                                <a href=""><span>
+                                <a href=""><span class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;
+                                    PGA to Airavata Authentication Successful</a>
+                            </li>
+                            <li>
+                                <a href=""><span class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;
+                                    Airavata to Resource Authentication Successful</a>
+                            </li>
+                        </ul>
+                    </li>
+                    <li>
+                        <span class="badge badge-success"><i class="icon-minus-sign"></i>Input Staging</span>
+                        <ul>
+                            <li>
+                                <span class="alert alert-success"><i
+                                        class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; <a href="">PGA to
+                                    Airavata File Transfer Successful</a>
+                            </li>
+                            <li>
+                                <span class="alert alert-success" abhi><i
+                                        class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; <a href="">Airavata to
+                                    Resource File Transfer Successful</a>
+                            </li>
+                        </ul>
+                    </li>
+                    <li>
+                        <span class="badge badge-warning"><i class="icon-minus-sign"></i>Job Description</span>
+                        <ul>
+                            <li>
+                                <a href=""><span>
                                                    Long Script of Job Description / PBS Script <br/>
                                                    <br/>
                                                     <p>
-                                                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. Aenean
+                                                        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean
+                                                        commodo ligula eget dolor. Aenean massa. Cum sociis natoque
+                                                        penatibus et magnis dis parturient montes, nascetur ridiculus
+                                                        mus. Donec quam felis, ultricies nec, pellentesque eu, pretium
+                                                        quis, sem. Nulla consequat massa quis enim. Donec pede justo,
+                                                        fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo,
+                                                        rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum
+                                                        felis eu pede mollis pretium. Integer tincidunt. Cras dapibus.
+                                                        Vivamus elementum semper nisi. Aenean vulputate eleifend tellus.
+                                                        Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac,
+                                                        enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a,
+                                                        tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque
+                                                        rutrum. Aenean
                                                     </p>
                                                  </span></a>
-                                            </li>
-                                        </ul>
-                                    </li>
-                                    <li>
-                                        <span class="badge badge-important"><i class="icon-minus-sign"></i>Execution</span>
-                                        <ul>
-                                            <li>
-                                                <a href=""><span  class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; Execution of Job Description - No errors</a>
-                                            </li>
-                                        </ul>
-                                    </li>
-
-                                    <li>
-                                        <span class="badge badge-important"><i class="icon-minus-sign"></i>Experiment Complete</span>
-                                        <ul>
-                                            <li>
-                                                <a href=""><span  class="alert alert-danger"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; Output Transfer from Resource to Airavata UnSuccessful</a>
-                                                <br/>
-                                                <span> Some text about failure</span>
-                                            </li>
-                                            <li>
-                                                <a href=""><span  class="alert alert-danger"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash; Output Transfer from Airavata to PGA UnSuccessful</a>
-                                                <br/>
-                                                <span> Some text about failure</span>
-                                            </li>
-                                        </ul>
-                                    </li>
-
-
-                                </ul>
                             </li>
                         </ul>
-                    </div>
-                </div>
-            </div>
-            <!-- /.container-fluid -->
+                    </li>
+                    <li>
+                        <span class="badge badge-important"><i class="icon-minus-sign"></i>Execution</span>
+                        <ul>
+                            <li>
+                                <a href=""><span class="alert alert-success"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;
+                                    Execution of Job Description - No errors</a>
+                            </li>
+                        </ul>
+                    </li>
 
-        </div>
-        <!-- /#page-wrapper -->
+                    <li>
+                        <span class="badge badge-important"><i class="icon-minus-sign"></i>Experiment Complete</span>
+                        <ul>
+                            <li>
+                                <a href=""><span class="alert alert-danger"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;
+                                    Output Transfer from Resource to Airavata UnSuccessful</a>
+                                <br/>
+                                <span> Some text about failure</span>
+                            </li>
+                            <li>
+                                <a href=""><span class="alert alert-danger"><i class="icon-time"></i>2015-04-17 15:21:21</span> &ndash;
+                                    Output Transfer from Airavata to PGA UnSuccessful</a>
+                                <br/>
+                                <span> Some text about failure</span>
+                            </li>
+                        </ul>
+                    </li>
 
-    </div>
 
-@stop
+                </ul>
+            </li>
+        </ul>
+    </div>
+</div>
+</div>
+<!-- /.container-fluid -->
 
+</div>
+<!-- /#page-wrapper -->
 
-@section('scripts')
-    @parent
-    {{ HTML::script('js/gateway.js') }} 
-    {{ HTML::script('js/moment.js')}}   
-    {{ HTML::script('js/datetimepicker.js')}}    
+</div>
 
-    <!-- Morris Charts JavaScript -->
-    <!--
-    to be uncommented when actually in use. 
+@stop
 
-    {{ HTML::script('js/morris/raphael.min.js')}}
-    {{ HTML::script('js/morris/morris.min.js')}}
-    {{ HTML::script('js/morris/morris-data.js')}}
-    -->
 
-    <!-- Flot Charts JavaScript -->
-    <!--[if lte IE 8]><script src="js/excanvas.min.js')}}<![endif]-->
-    {{ HTML::script('js/flot/jquery.flot.js')}}
-    {{ HTML::script('js/flot/jquery.flot.tooltip.min.js')}}
-    {{ HTML::script('js/flot/jquery.flot.resize.js')}}
-    {{ HTML::script('js/flot/jquery.flot.pie.js')}}
-    {{ HTML::script('js/flot/flot-data.js')}}        
-    <script>
-
-        //make first tab of accordion open by default.
-        //temporary fix
-        $("#accordion2").children(".panel").children(".collapse").addClass("in");
-        $(".add-tenant").slideUp();
-        
-        $(".toggle-add-tenant").click( function(){
-            $(".add-tenant").slideDown();
+@section('scripts')
+@parent
+{{ HTML::script('js/gateway.js') }}
+{{ HTML::script('js/moment.js')}}
+{{ HTML::script('js/datetimepicker.js')}}
+
+<!-- Morris Charts JavaScript -->
+<!--
+to be uncommented when actually in use.
+
+{{ HTML::script('js/morris/raphael.min.js')}}
+{{ HTML::script('js/morris/morris.min.js')}}
+{{ HTML::script('js/morris/morris-data.js')}}
+-->
+
+<!-- Flot Charts JavaScript -->
+<!--[if lte IE 8]>
+<script src="js/excanvas.min.js')}}<![endif]-->
+{{ HTML::script('js/flot/jquery.flot.js')}}
+{{ HTML::script('js/flot/jquery.flot.tooltip.min.js')}}
+{{ HTML::script('js/flot/jquery.flot.resize.js')}}
+{{ HTML::script('js/flot/jquery.flot.pie.js')}}
+{{ HTML::script('js/flot/flot-data.js')}}
+<script>
+
+    //make first tab of accordion open by default.
+    //temporary fix
+    $("#accordion2").children(".panel").children(".collapse").addClass("in");
+    $(".add-tenant").slideUp();
+
+    $(".toggle-add-tenant").click(function () {
+        $(".add-tenant").slideDown();
+    });
+
+    $(function () {
+        $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
+        $('.tree li.parent_li > span').on('click', function (e) {
+            var children = $(this).parent('li.parent_li').find(' > ul > li');
+            if (children.is(":visible")) {
+                children.hide('fast');
+                $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
+            } else {
+                children.show('fast');
+                $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
+            }
+            e.stopPropagation();
         });
 
-        $(function () {
-            $('.tree li:has(ul)').addClass('parent_li').find(' > span').attr('title', 'Collapse this branch');
-            $('.tree li.parent_li > span').on('click', function (e) {
-                var children = $(this).parent('li.parent_li').find(' > ul > li');
-                if (children.is(":visible")) {
-                    children.hide('fast');
-                    $(this).attr('title', 'Expand this branch').find(' > i').addClass('icon-plus-sign').removeClass('icon-minus-sign');
-                } else {
-                    children.show('fast');
-                    $(this).attr('title', 'Collapse this branch').find(' > i').addClass('icon-minus-sign').removeClass('icon-plus-sign');
-                }
-                e.stopPropagation();
-            });
+        $(".get-experiment").click(function () {
+            $(".loading-img").removeClass("hide");
+            $.ajax({
+                url: 'experiment/summary?expId=' + $(".experimentId").val(),
+                type: 'get',
+                success: function (data) {
+                    $(".experiment-info").html(data);
 
-            $(".get-experiment").click( function(){
-                $(".loading-img").removeClass("hide");
-                $.ajax({
-                    url:'experiment/summary?expId=' + $(".experimentId").val(),
-                    type: 'get',
-                    success:function( data){
-                        $(".experiment-info").html( data);
-
-                    }
-                }).complete( function(){
-                    $(".loading-img").addClass("hide");
-                });
+                }
+            }).complete(function () {
+                $(".loading-img").addClass("hide");
             });
+        });
 
-            //Experiment stages are under development.
-            $(".tree").parent().addClass("hide");
-
-            /* making datetimepicker work for exp search */
+        //Experiment stages are under development.
+        $(".tree").parent().addClass("hide");
 
-            $('#datetimepicker9').datetimepicker({
-                pick12HourFormat: false
-            });
-            $('#datetimepicker10').datetimepicker({
-                pick12HourFormat: false
-            });
-            $("#datetimepicker9").on("dp.change",function (e) {
-               $('#datetimepicker10').data("DateTimePicker").setMinDate(e.date);
-            });
-            $("#datetimepicker10").on("dp.change",function (e) {
-               $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date);
-            });
+        /* making datetimepicker work for exp search */
 
-            /* selecting creation time */
-            $("#search-key").on("change", function(){
-                if( this.value == "creation-time")
-                {
-                    $(".search-text-block").addClass("hide");
-                    $(".select-dates").removeClass("hide");
-                    $("#search-value").removeAttr("required");
-
-                }
-                else
-                {
-                    $(".search-text-block").removeClass("hide");
-                    $(".select-dates").addClass("hide");
-                    $("#search-value").attr("required");
-                }
-            });
+        $('#datetimepicker9').datetimepicker({
+            pick12HourFormat: false
+        });
+        $('#datetimepicker10').datetimepicker({
+            pick12HourFormat: false
+        });
+        $("#datetimepicker9").on("dp.change", function (e) {
+            $('#datetimepicker10').data("DateTimePicker").setMinDate(e.date);
+        });
+        $("#datetimepicker10").on("dp.change", function (e) {
+            $('#datetimepicker9').data("DateTimePicker").setMaxDate(e.date);
+        });
 
+        /* selecting creation time */
+        $("#search-key").on("change", function () {
+            if (this.value == "creation-time") {
+                $(".search-text-block").addClass("hide");
+                $(".select-dates").removeClass("hide");
+                $("#search-value").removeAttr("required");
+
+            }
+            else {
+                $(".search-text-block").removeClass("hide");
+                $(".select-dates").addClass("hide");
+                $("#search-value").attr("required");
+            }
         });
-    </script>
+
+    });
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-gateway.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-gateway.blade.php b/app/views/admin/manage-gateway.blade.php
index 167fc36..2032373 100644
--- a/app/views/admin/manage-gateway.blade.php
+++ b/app/views/admin/manage-gateway.blade.php
@@ -1,132 +1,158 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}
+@parent
+{{ HTML::style('css/admin.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-            @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-            <div class="col-md-12">
+<div id="wrapper">
+    <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+    @include( 'partials/dashboard-block')
+    <div id="page-wrapper">
+        <div class="col-md-12">
             @if( Session::has("message"))
-                <div class="row">
-                    <div class="alert alert-success alert-dismissible" role="alert">
-                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                        {{ Session::get("message") }}
-                    </div>
+            <div class="row">
+                <div class="alert alert-success alert-dismissible" role="alert">
+                    <button type="button" class="close" data-dismiss="alert"><span
+                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+                    {{ Session::get("message") }}
                 </div>
-                {{ Session::forget("message") }}
-            @endif
             </div>
-            <div class="container-fluid">
+            {{ Session::forget("message") }}
+            @endif
+        </div>
+        <div class="container-fluid">
 
-                <div class="row">
+            <div class="row">
 
-                    <div class="col-md-6">
-                        <h3>Gateway Settings</h3>
-                    </div>
-                    @if( Session::has("scigap_admin"))
-                    <div class="col-md-6" style="margin-top:3.5%">
-                        <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name" />
-                    </div>
-                    @endif
+                <div class="col-md-6">
+                    <h3>Gateway Settings</h3>
                 </div>
-                <div class="panel-group" id="accordion2">
+                @if( Session::has("scigap_admin"))
+                <div class="col-md-6" style="margin-top:3.5%">
+                    <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name"/>
+                </div>
+                @endif
+            </div>
+            <div class="panel-group" id="accordion2">
                 @foreach( $gateways as $indexGP => $gp )
-                    <div class="panel panel-default">
-                        <div class="panel-heading">
-                            <h4 class="panel-title">
-                                <a class="accordion-toggle collapsed gateway-name" data-toggle="collapse" data-parent="#accordion2" href="#collapse-gateway-{{$indexGP}}">
+                <div class="panel panel-default">
+                    <div class="panel-heading">
+                        <h4 class="panel-title">
+                            <a class="accordion-toggle collapsed gateway-name" data-toggle="collapse"
+                               data-parent="#accordion2" href="#collapse-gateway-{{$indexGP}}">
                                 {{ $gp->gatewayName }}
-                                </a>
-                                <div class="pull-right col-md-2 gateway-options fade">
-                                    <span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#edit-gateway-block" data-gp-id="{{ $gp->gatewayId }}" data-gp-name="{{ $gp->gatewayName }}"></span>
-                                </div>
-                            </h4>
-                        </div>
-                        <div id="collapse-gateway-{{$indexGP}}" class="panel-collapse collapse">
-                            <div class="panel-body">
-                                <div class="app-interface-block">
-                                    <div class="row">
-                                        <div class="col-md-10">
-                                            <button class="btn btn-default add-cr" data-gpid="{{$gp->gatewayId}}"><span class="glyphicon glyphicon-plus"></span> Add a Compute Resource</button>
+                            </a>
+
+                            <div class="pull-right col-md-2 gateway-options fade">
+                                <span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;"
+                                      data-toggle="modal" data-target="#edit-gateway-block"
+                                      data-gp-id="{{ $gp->gatewayId }}" data-gp-name="{{ $gp->gatewayName }}"></span>
+                            </div>
+                        </h4>
+                    </div>
+                    <div id="collapse-gateway-{{$indexGP}}" class="panel-collapse collapse">
+                        <div class="panel-body">
+                            <div class="app-interface-block">
+                                <div class="row">
+                                    <div class="col-md-10">
+                                        <button class="btn btn-default add-cr" data-gpid="{{$gp->gatewayId}}"><span
+                                                class="glyphicon glyphicon-plus"></span> Add a Compute Resource
+                                        </button>
+                                    </div>
+                                    <div class="col-md-10">
+                                        @if( isset( $gp->profile->computeResourcePreferences) )
+                                        <div class="col-md-12">
+                                            <h3>Existing Compute Resources :</h3>
                                         </div>
-                                        <div class="col-md-10">
-                                            @if( isset( $gp->profile->computeResourcePreferences) )
-                                                <div class="col-md-12">
-                                                    <h3>Existing Compute Resources :</h3>
-                                                </div>
-                                            <div class="accordion-inner">
-                                                <div class="panel-group" id="accordion-{{$indexGP}}">
-                                                @foreach( (array)$gp->profile->computeResourcePreferences as $indexCRP => $crp )
-                                                    <div class="panel panel-default">
-                                                        <div class="panel-heading">
-                                                            <h4 class="panel-title">
-                                                                <a class="accordion-toggle collapsed gateway-name" data-toggle="collapse" data-parent="#accordion" href="#collapse-crp-{{$indexGP}}-{{$indexCRP}}">
+                                        <div class="accordion-inner">
+                                            <div class="panel-group" id="accordion-{{$indexGP}}">
+                                                @foreach( (array)$gp->profile->computeResourcePreferences as $indexCRP
+                                                => $crp )
+                                                <div class="panel panel-default">
+                                                    <div class="panel-heading">
+                                                        <h4 class="panel-title">
+                                                            <a class="accordion-toggle collapsed gateway-name"
+                                                               data-toggle="collapse" data-parent="#accordion"
+                                                               href="#collapse-crp-{{$indexGP}}-{{$indexCRP}}">
                                                                 {{ $crp->crDetails->hostName }}
-                                                                </a>
-                                                                <div class="pull-right col-md-2 gateway-options fade">
-                                                                    <span class="glyphicon glyphicon-remove remove-resource" style="cursor:pointer;" data-toggle="modal" data-target="#remove-resource-block" data-cr-name="{{$crp->crDetails->hostName}}" data-cr-id="{{$crp->computeResourceId}}" data-gp-id="{{ $gp->gatewayId }}"></span>
-                                                                </div>
-                                                            </h4>
-                                                        </div>
-                                                        <div id="collapse-crp-{{$indexGP}}-{{$indexCRP}}" class="panel-collapse collapse">
-                                                            <div class="panel-body">
-                                                                <div class="app-compute-resource-preferences-block">
-                                                                    <form action="{{URL::to('/')}}/gp/update-crp" method="POST">
-                                                                        <input type="hidden" name="gatewayId" id="gatewayId" value="{{$gp->gatewayId}}">
-                                                                        <input type="hidden" name="computeResourceId" id="gatewayId" value="{{$crp->computeResourceId}}">
-                                                                        <div class="form-horizontal">
-                                                                            @include('partials/gateway-preferences', array('computeResource' => $crp->crDetails, 'crData' => $crData, 'preferences'=>$crp, 'show'=>true))
-                                                                        </div>
-                                                                    </form>
-                                                                </div>
+                                                            </a>
+
+                                                            <div class="pull-right col-md-2 gateway-options fade">
+                                                                <span class="glyphicon glyphicon-remove remove-resource"
+                                                                      style="cursor:pointer;" data-toggle="modal"
+                                                                      data-target="#remove-resource-block"
+                                                                      data-cr-name="{{$crp->crDetails->hostName}}"
+                                                                      data-cr-id="{{$crp->computeResourceId}}"
+                                                                      data-gp-id="{{ $gp->gatewayId }}"></span>
+                                                            </div>
+                                                        </h4>
+                                                    </div>
+                                                    <div id="collapse-crp-{{$indexGP}}-{{$indexCRP}}"
+                                                         class="panel-collapse collapse">
+                                                        <div class="panel-body">
+                                                            <div class="app-compute-resource-preferences-block">
+                                                                <form action="{{URL::to('/')}}/gp/update-crp"
+                                                                      method="POST">
+                                                                    <input type="hidden" name="gatewayId" id="gatewayId"
+                                                                           value="{{$gp->gatewayId}}">
+                                                                    <input type="hidden" name="computeResourceId"
+                                                                           id="gatewayId"
+                                                                           value="{{$crp->computeResourceId}}">
+
+                                                                    <div class="form-horizontal">
+                                                                        @include('partials/gateway-preferences',
+                                                                        array('computeResource' => $crp->crDetails,
+                                                                        'crData' => $crData, 'preferences'=>$crp,
+                                                                        'show'=>true))
+                                                                    </div>
+                                                                </form>
                                                             </div>
                                                         </div>
                                                     </div>
-                                                @endforeach
                                                 </div>
+                                                @endforeach
                                             </div>
-                                            @endif
-                                            <!-- 
-                                            Adding a user as admin will shift to roles. Removing from here. 
-                                            <h4><span class="glyphicon glyphicon-plus"></span> Add a user as Admin to this Gateway</h4>
-                                            <form action="{{URL::to('/')}}/admin/addgatewayadmin" method="POST" role="form" enctype="multipart/form-data">
-                                                <div class="form-group required">
-                                                    <label for="experiment-name" class="control-label">Enter Username</label>
-                                                    <input type="text" class="form-control" name="username" id="experiment-name" placeholder="username" autofocus required="required">
-                                                    <input type="hidden" name="gateway_name" value="{{ $gp->gatewayName }}"/>
-                                                </div>
-                                                <div class="btn-toolbar">
-                                                    <input name="add" type="submit" class="btn btn-primary" value="Add Admin"/>
-                                                </div>   
-                                            </form>
-                                            -->
                                         </div>
+                                        @endif
+                                        <!--
+                                        Adding a user as admin will shift to roles. Removing from here.
+                                        <h4><span class="glyphicon glyphicon-plus"></span> Add a user as Admin to this Gateway</h4>
+                                        <form action="{{URL::to('/')}}/admin/addgatewayadmin" method="POST" role="form" enctype="multipart/form-data">
+                                            <div class="form-group required">
+                                                <label for="experiment-name" class="control-label">Enter Username</label>
+                                                <input type="text" class="form-control" name="username" id="experiment-name" placeholder="username" autofocus required="required">
+                                                <input type="hidden" name="gateway_name" value="{{ $gp->gatewayName }}"/>
+                                            </div>
+                                            <div class="btn-toolbar">
+                                                <input name="add" type="submit" class="btn btn-primary" value="Add Admin"/>
+                                            </div>
+                                        </form>
+                                        -->
                                     </div>
                                 </div>
                             </div>
                         </div>
                     </div>
-                @endforeach
                 </div>
+                @endforeach
             </div>
-            <!-- /.container-fluid -->
-
         </div>
-        <!-- /#page-wrapper -->
+        <!-- /.container-fluid -->
 
     </div>
+    <!-- /#page-wrapper -->
+
+</div>
 
 
 <div class="add-compute-resource-block hide">
     <div class="well">
         <form action="{{URL::to('/')}}/gp/add-crp" method="POST">
             <input type="hidden" name="gatewayId" id="gatewayId" value="">
+
             <div class="input-group">
                 <select name="computeResourceId" class="cr-select form-control">
                     <option value="">Select a compute Resource and set its preferences</option>
@@ -137,13 +163,14 @@
                 <span class="input-group-addon remove-cr" style="cursor:pointer;">x</span>
             </div>
             <div class="pref-space form-horizontal"></div>
-        </form> 
+        </form>
     </div>
 </div>
 
 
 <!-- Remove a Compute Resource from a Gateway -->
-<div class="modal fade" id="remove-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
+<div class="modal fade" id="remove-resource-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
     <div class="modal-dialog">
 
         <form action="{{URL::to('/')}}/gp/remove-cr" method="POST">
@@ -155,12 +182,13 @@
                     <input type="hidden" class="form-control remove-crId" name="rem-crId"/>
                     <input type="hidden" class="form-control cr-gpId" name="gpId"/>
 
-                    Do you really want to remove the Compute Resource, <span class="remove-cr-name"> </span>from the selected Gateway?
+                    Do you really want to remove the Compute Resource, <span class="remove-cr-name"> </span>from the
+                    selected Gateway?
                 </div>
                 <div class="modal-footer">
                     <div class="form-group">
                         <input type="submit" class="btn btn-danger" value="Remove"/>
-                        <input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
                     </div>
                 </div>
             </div>
@@ -171,21 +199,20 @@
 
 <!-- contains all compute resource choices that might get selected on adding a new one to a gateway -->
 @foreach( (array)$computeResources as $index => $cr)
-    @include('partials/gateway-preferences', array('computeResource' => $cr, 'crData' => $crData))
+@include('partials/gateway-preferences', array('computeResource' => $cr, 'crData' => $crData))
 @endforeach
 
 
-
 @stop
 
 
 @section('scripts')
-    @parent
-    {{ HTML::script('js/gateway.js') }}
-    <script>
-
-        //make first tab of accordion open by default.
-        //temporary fix
-        $("#accordion2").children(".panel").children(".collapse").addClass("in");
-    </script>
+@parent
+{{ HTML::script('js/gateway.js') }}
+<script>
+
+    //make first tab of accordion open by default.
+    //temporary fix
+    $("#accordion2").children(".panel").children(".collapse").addClass("in");
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-resources.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-resources.blade.php b/app/views/admin/manage-resources.blade.php
index b13ef16..092008a 100644
--- a/app/views/admin/manage-resources.blade.php
+++ b/app/views/admin/manage-resources.blade.php
@@ -1,68 +1,71 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}
+@parent
+{{ HTML::style('css/admin.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-            @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-            <div class="col-md-12">
+<div id="wrapper">
+    <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+    @include( 'partials/dashboard-block')
+    <div id="page-wrapper">
+        <div class="col-md-12">
             @if( Session::has("message"))
-                <div class="row">
-                    <div class="alert alert-success alert-dismissible" role="alert">
-                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                        {{ Session::get("message") }}
-                    </div>
+            <div class="row">
+                <div class="alert alert-success alert-dismissible" role="alert">
+                    <button type="button" class="close" data-dismiss="alert"><span
+                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
+                    {{ Session::get("message") }}
                 </div>
-                {{ Session::forget("message") }}
-            @endif
             </div>
-            <div class="container-fluid">
-                <div class="col-md-12">
-                    <h1 class="text-center well alert alert-danger" >Proposed(Dummy) UI for maintaining availability of Resources. More fields can be added.</h1>
-                    <h1 class="text-center">Resources</h1>
+            {{ Session::forget("message") }}
+            @endif
+        </div>
+        <div class="container-fluid">
+            <div class="col-md-12">
+                <h1 class="text-center well alert alert-danger">Proposed(Dummy) UI for maintaining availability of
+                    Resources. More fields can be added.</h1>
 
-                    <table class="table table-striped table-condensed">
-                        <tr>
-                            <th>ID</th>
-                            <th>Name</th>
-                            <th>
-                                Status
-                            </th>
-                        </tr>
-                        @foreach( (array)$resources as $resourceId => $resourceName )
-                        <tr class="user-row">
-                            <td>{{ $resourceId }}</td>
-                            <td>{{ $resourceName }}</td>
-                            <td>
-                                <!--This is a random selection -->
-                                @if( strpos( $resourceName, "a") )
-                                    <div class="btn-group btn-toggle"> 
-                                        <button class="btn btn-xs btn-default">ON</button>
-                                        <button class="btn btn-xs btn-danger active">Switch OFF</button>
-                                    </div>
-                                @else
-                                    <div class="btn-group btn-toggle"> 
-                                        <button class="btn btn-xs btn-success active">Switch ON</button>
-                                        <button class="btn btn-xs btn-default">OFF</button>
-                                    </div>
-                                @endif
-                            </td>
-                        </tr>
-                        @endforeach
-                    </table>
+                <h1 class="text-center">Resources</h1>
+
+                <table class="table table-striped table-condensed">
+                    <tr>
+                        <th>ID</th>
+                        <th>Name</th>
+                        <th>
+                            Status
+                        </th>
+                    </tr>
+                    @foreach( (array)$resources as $resourceId => $resourceName )
+                    <tr class="user-row">
+                        <td>{{ $resourceId }}</td>
+                        <td>{{ $resourceName }}</td>
+                        <td>
+                            <!--This is a random selection -->
+                            @if( strpos( $resourceName, "a") )
+                            <div class="btn-group btn-toggle">
+                                <button class="btn btn-xs btn-default">ON</button>
+                                <button class="btn btn-xs btn-danger active">Switch OFF</button>
+                            </div>
+                            @else
+                            <div class="btn-group btn-toggle">
+                                <button class="btn btn-xs btn-success active">Switch ON</button>
+                                <button class="btn btn-xs btn-default">OFF</button>
+                            </div>
+                            @endif
+                        </td>
+                    </tr>
+                    @endforeach
+                </table>
 
-                </div>
             </div>
         </div>
     </div>
+</div>
 @stop
 
 @section('scripts')
-    @parent
+@parent
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-roles.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-roles.blade.php b/app/views/admin/manage-roles.blade.php
index fa39a75..8a51371 100644
--- a/app/views/admin/manage-roles.blade.php
+++ b/app/views/admin/manage-roles.blade.php
@@ -1,138 +1,141 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}
+@parent
+{{ HTML::style('css/admin.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-            <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-            @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-
-            <div class="container-fluid">
+<div id="wrapper">
+    <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+    @include( 'partials/dashboard-block')
+    <div id="page-wrapper">
+
+        <div class="container-fluid">
+            <div class="col-md-12">
+                @if( Session::has("message"))
+                <div class="row">
+                    <div class="alert alert-success alert-dismissible" role="alert">
+                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                                class="sr-only">Close</span></button>
+                        {{ Session::get("message") }}
+                    </div>
+                </div>
+                {{ Session::forget("message") }}
+                @endif
+
+                <h1 class="text-center">Roles</h1>
+
+                <table class="table table-striped table-condensed">
+                    <tr>
+                        <th>
+                            Role
+                        </th>
+                        <th>Actions</th>
+                    </tr>
+                    @foreach( $roles as $role)
+                    <tr>
+                        <td class="role-name">{{ $role }}</td>
+                        <td>
+                            <span class="glyphicon glyphicon-pencil edit-role-name"></span>&nbsp;&nbsp;
+                            <a href="{{URL::to('/')}}/admin/dashboard/users?role={{$role}}">
+                                <span class="glyphicon glyphicon-user role-users"></span>&nbsp;&nbsp;
+                            </a>
+                            <span class="glyphicon glyphicon-trash delete-role"></span>&nbsp;&nbsp;
+                        </td>
+                    </tr>
+                    @endforeach
+                </table>
                 <div class="col-md-12">
-                    @if( Session::has("message"))
-                        <div class="row">
-                            <div class="alert alert-success alert-dismissible" role="alert">
-                                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                                {{ Session::get("message") }}
-                            </div>
+                    <button type="button" class="btn btn-default toggle-add-role"><span
+                            class="glyphicon glyphicon-plus"></span>Add a new Role
+                    </button>
+                </div>
+                <div class="add-role col-md-6">
+                    <form role="form" action="{{URL::to('/')}}/admin/addrole" method="POST" class="add-role-form">
+                        <div class="form-group">
+                            <label>Enter Role Name</label>
+                            <input type="text" name="role" class="form-control"/>
                         </div>
-                        {{ Session::forget("message") }}
-                    @endif
-
-                    <h1 class="text-center">Roles</h1>
-
-                    <table class="table table-striped table-condensed">
-                        <tr>
-                            <th>
-                                Role</th>
-                            <th>Actions</th>
-                        </tr>
-                        @foreach( $roles as $role)
-                        <tr>
-                            <td class="role-name">{{ $role }}</td>
-                            <td>
-                                <span class="glyphicon glyphicon-pencil edit-role-name"></span>&nbsp;&nbsp;
-                                <a href="{{URL::to('/')}}/admin/dashboard/users?role={{$role}}">
-                                    <span class="glyphicon glyphicon-user role-users"></span>&nbsp;&nbsp;
-                                </a>
-                                <span class="glyphicon glyphicon-trash delete-role"></span>&nbsp;&nbsp;
-                            </td>
-                        </tr>
-                        @endforeach
-                    </table>
-                    <div class="col-md-12">
-                        <button type="button" class="btn btn-default toggle-add-role"><span class="glyphicon glyphicon-plus"></span>Add a new Role</button>
-                    </div>
-                    <div class="add-role col-md-6">
-                        <form role="form" action="{{URL::to('/')}}/admin/addrole" method="POST" class="add-role-form">
-                            <div class="form-group">
-                                <label>Enter Role Name</label>
-                                <input type="text" name="role" class="form-control"/>
-                            </div>
-                            <div class="form-group">
-                                <input type="submit" class="form-control btn btn-primary" value="Add" />
-                            </div>
-                        </form>
-                    </div>
-
-                    <div class="edit-role hide">
-                        <form class="edit-role-form">
-                            <div class="form-group col-md-4">
-                                <input type="text" name="new-role-name" class="new-role-name form-control"/>
-                                <input type="hidden" name="original-role-name" class="original-role-name" value=""/>
-                            </div>
-                            <div class="form-group col-md-4">
-                                <input type="submit" class="form-control btn btn-primary" value="Edit" />
-                            </div>
-                        </form>
-                    </div>
+                        <div class="form-group">
+                            <input type="submit" class="form-control btn btn-primary" value="Add"/>
+                        </div>
+                    </form>
+                </div>
 
+                <div class="edit-role hide">
+                    <form class="edit-role-form">
+                        <div class="form-group col-md-4">
+                            <input type="text" name="new-role-name" class="new-role-name form-control"/>
+                            <input type="hidden" name="original-role-name" class="original-role-name" value=""/>
+                        </div>
+                        <div class="form-group col-md-4">
+                            <input type="submit" class="form-control btn btn-primary" value="Edit"/>
+                        </div>
+                    </form>
                 </div>
+
             </div>
         </div>
     </div>
+</div>
 
-    <div class="modal fade" id="delete-role-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-        <div class="modal-dialog">
+<div class="modal fade" id="delete-role-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
 
-            <form action="{{URL::to('/')}}/admin/deleterole" method="POST">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h3 class="text-center">Delete Role Confirmation</h3>
-                    </div>
-                    <div class="modal-body">
-                        <input type="hidden" class="form-control delete-roleName" name="role"/>
-                        Do you really want to delete the role - <span class="delete-role-name"></span>
-                    </div>
-                    <div class="modal-footer">
-                        <div class="form-group">
-                            <input type="submit" class="btn btn-danger" value="Delete"/>
-                            <input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-                        </div>
+        <form action="{{URL::to('/')}}/admin/deleterole" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Delete Role Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control delete-roleName" name="role"/>
+                    Do you really want to delete the role - <span class="delete-role-name"></span>
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Delete"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
                     </div>
                 </div>
+            </div>
 
-            </form>
+        </form>
 
 
-        </div>
     </div>
+</div>
 
 
 @stop
 
 @section('scripts')
-    @parent
-    <script>
-        $(".toggle-add-role").click( function(){
-            $(".add-role").slideDown();
-        });
-
-        $(".edit-role-name").click( function(){
-            var roleNameSpace = $(this).parent().parent().find(".role-name");
-            if( roleNameSpace.find(".edit-role-form").length )
-            {
-                roleNameSpace.html( roleNameSpace.find(".original-role-name").val() );
-            }
-            else
-            {
-                var role = roleNameSpace.html();
-                roleNameSpace.html( $(".edit-role").html() );
-                roleNameSpace.find(".original-role-name").val( role );
-                roleNameSpace.find(".new-role-name").val( role );
-            }
-        });
-
-        $(".delete-role").click( function(){
-            $("#delete-role-block").modal("show");
-            var roleName = $(this).parent().parent().find(".role-name").html();
-            $(".delete-role-name").html(roleName);
-            $(".delete-roleName").val(roleName);
-        });
-    </script>
+@parent
+<script>
+    $(".toggle-add-role").click(function () {
+        $(".add-role").slideDown();
+    });
+
+    $(".edit-role-name").click(function () {
+        var roleNameSpace = $(this).parent().parent().find(".role-name");
+        if (roleNameSpace.find(".edit-role-form").length) {
+            roleNameSpace.html(roleNameSpace.find(".original-role-name").val());
+        }
+        else {
+            var role = roleNameSpace.html();
+            roleNameSpace.html($(".edit-role").html());
+            roleNameSpace.find(".original-role-name").val(role);
+            roleNameSpace.find(".new-role-name").val(role);
+        }
+    });
+
+    $(".delete-role").click(function () {
+        $("#delete-role-block").modal("show");
+        var roleName = $(this).parent().parent().find(".role-name").html();
+        $(".delete-role-name").html(roleName);
+        $(".delete-roleName").val(roleName);
+    });
+</script>
 @stop
\ No newline at end of file


[06/10] airavata-php-gateway git commit: Cleaning and restructuring PGA

Posted by sc...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/account/forgot-password.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/forgot-password.blade.php b/app/views/account/forgot-password.blade.php
index b9c8274..4806b6f 100644
--- a/app/views/account/forgot-password.blade.php
+++ b/app/views/account/forgot-password.blade.php
@@ -1,18 +1,19 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
 <div class="col-md-offset-3 col-md-6">
 
-<h3> Did you forget the password to your account? </h3>
-<h4> Please enter your email id, you registered with.</h4>
-<div class="form-group form-horizontal">
-	<div class="col-md-8"><input type="email" value="" class="form-control" placeholder="email"/></div>
-	<div class="col-md-2"><input type="submit" class="form-control btn btn-primary"value="Submit"/></div>
-</div>
+    <h3> Did you forget the password to your account? </h3>
+    <h4> Please enter your email id, you registered with.</h4>
 
-@stop
\ No newline at end of file
+    <div class="form-group form-horizontal">
+        <div class="col-md-8"><input type="email" value="" class="form-control" placeholder="email"/></div>
+        <div class="col-md-2"><input type="submit" class="form-control btn btn-primary" value="Submit"/></div>
+    </div>
+
+    @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/account/login.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/login.blade.php b/app/views/account/login.blade.php
index 0e13cd0..2d6d58e 100755
--- a/app/views/account/login.blade.php
+++ b/app/views/account/login.blade.php
@@ -1,44 +1,43 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 
-    <div class="col-md-offset-4 col-md-4">
-
-        <h3>
-            Login
-            <small>
-                <small> (Not registered? <a href="create">Create account</a>)</small>
-            </small>
-        </h3>
-
-        
-
-        <form action="login" method="post" role="form">
-            @if( Session::has("invalid-credentials") )
-                {{ Utilities::print_error_message('Invalid username or password. Please try again.') }}
-            @endif
-            <?php
-            Session::forget( "invalid-credentials");
-            ?>
-
-            <div class="form-group">
-                <label class="sr-only" for="username">Username</label>
-                <input type="text" class="form-control" name="username" placeholder="Username" autofocus required>
-            </div>
-            <div class="form-group">
-                <label class="sr-only" for="password">Password</label>
-                <input type="password" class="form-control" name="password" placeholder="Password" required>
-            </div>
-            <input name="Submit" type="submit" class="btn btn-primary btn-block" value="Sign in">
-        </form>
-
-            <small>
-                <small> (Forgot Password? Click <a href="{{URL::to('/') }}/forgot-password">here</a>)</small>
-            </small>
-    </div>
+<div class="col-md-offset-4 col-md-4">
+
+    <h3>
+        Login
+        <small>
+            <small> (Not registered? <a href="create">Create account</a>)</small>
+        </small>
+    </h3>
+
+
+    <form action="login" method="post" role="form">
+        @if( Session::has("invalid-credentials") )
+        {{ Utilities::print_error_message('Invalid username or password. Please try again.') }}
+        @endif
+        <?php
+        Session::forget("invalid-credentials");
+        ?>
+
+        <div class="form-group">
+            <label class="sr-only" for="username">Username</label>
+            <input type="text" class="form-control" name="username" placeholder="Username" autofocus required>
+        </div>
+        <div class="form-group">
+            <label class="sr-only" for="password">Password</label>
+            <input type="password" class="form-control" name="password" placeholder="Password" required>
+        </div>
+        <input name="Submit" type="submit" class="btn btn-primary btn-block" value="Sign in">
+    </form>
+
+    <small>
+        <small> (Forgot Password? Click <a href="{{URL::to('/') }}/forgot-password">here</a>)</small>
+    </small>
+</div>
 
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/dashboard.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/dashboard.blade.php b/app/views/admin/dashboard.blade.php
index 0fd2ffc..77b57e0 100644
--- a/app/views/admin/dashboard.blade.php
+++ b/app/views/admin/dashboard.blade.php
@@ -1,20 +1,21 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 <div class="container">
     <div class="col-md-12">
         @if( Session::has("message"))
-            <div class="row">
-                <div class="alert alert-success alert-dismissible" role="alert">
-                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                    {{ Session::get("message") }}
-                </div>
+        <div class="row">
+            <div class="alert alert-success alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                        class="sr-only">Close</span></button>
+                {{ Session::get("message") }}
             </div>
-            {{ Session::forget("message") }}
+        </div>
+        {{ Session::forget("message") }}
         @endif
 
         <div class="row text-center">
@@ -22,56 +23,56 @@
         </div>
         <div class="row text-center admin-options">
 
-        <div class="row">
-            <a href="{{URL::to('/')}}/manage/users">
-                <div class="col-md-3 well">
-                    <div class="col-md-12">
-                        <span class="glyphicon glyphicon-user"></span>
-                    </div>
-                    <div class="col-md-12">
-                        Users
+            <div class="row">
+                <a href="{{URL::to('/')}}/manage/users">
+                    <div class="col-md-3 well">
+                        <div class="col-md-12">
+                            <span class="glyphicon glyphicon-user"></span>
+                        </div>
+                        <div class="col-md-12">
+                            Users
+                        </div>
                     </div>
-                </div>
-            </a>
+                </a>
 
-            <a href="{{URL::to('/')}}/admin/dashboard">
-                <div class=" col-md-offset-1 col-md-3 well">
-                    <div class="col-md-12">
-                        <span class="glyphicon glyphicon-eye-open"></span>
+                <a href="{{URL::to('/')}}/admin/dashboard">
+                    <div class=" col-md-offset-1 col-md-3 well">
+                        <div class="col-md-12">
+                            <span class="glyphicon glyphicon-eye-open"></span>
+                        </div>
+                        <div class="col-md-12">
+                            Admins
+                        </div>
                     </div>
-                    <div class="col-md-12">
-                        Admins
+                </a>
+
+                <a href="{{URL::to('/')}}/cr/browse">
+                    <div class=" col-md-offset-1 col-md-3 well">
+                        <div class="col-md-12">
+                            <span class="glyphicon glyphicon-briefcase"></span>
+                        </div>
+                        <div class="col-md-12">
+                            Resources
+                        </div>
                     </div>
-                </div>
-            </a>
+                </a>
+            </div>
 
-            <a href="{{URL::to('/')}}/cr/browse">
-                <div class=" col-md-offset-1 col-md-3 well">
+            <div class="row">
+                <div class="col-md-3 well">
                     <div class="col-md-12">
-                        <span class="glyphicon glyphicon-briefcase"></span>
+                        <span class="glyphicon glyphicon-tasks"></span>
                     </div>
                     <div class="col-md-12">
-                        Resources
+                        Application Catalog
                     </div>
+                    <select onchange="location = this.options[this.selectedIndex].value;">
+                        <option>-- Select --</option>
+                        <option value="{{URL::to('/')}}/app/interface">Interface</option>
+                        <option value="{{URL::to('/')}}/app/module">Module</option>
+                        <option value="{{URL::to('/')}}/app/deployment">Deployment</option>
+                    </select>
                 </div>
-            </a>
-        </div>
-
-        <div class="row">
-            <div class="col-md-3 well">
-                <div class="col-md-12">
-                    <span class="glyphicon glyphicon-tasks"></span>
-                </div>
-                <div class="col-md-12">
-                    Application Catalog
-                </div>
-                <select  onchange="location = this.options[this.selectedIndex].value;">
-                    <option>-- Select --</option>
-                    <option value="{{URL::to('/')}}/app/interface">Interface</option>
-                    <option value="{{URL::to('/')}}/app/module">Module</option>
-                    <option value="{{URL::to('/')}}/app/deployment">Deployment</option>
-                </select>
-            </div>
 
                 <div class=" col-md-offset-1 col-md-3 well">
                     <div class="col-md-12">
@@ -80,7 +81,7 @@
                     <div class="col-md-12">
                         Gateways
                     </div>
-                    <select  onchange="location = this.options[this.selectedIndex].value;">
+                    <select onchange="location = this.options[this.selectedIndex].value;">
                         <option>-- Select --</option>
                         <option value="{{URL::to('/')}}/gp/create">Create</option>
                         <option value="{{URL::to('/')}}/gp/browse">Browse</option>

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-admin.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-admin.blade.php b/app/views/admin/manage-admin.blade.php
index 05e317a..8477391 100644
--- a/app/views/admin/manage-admin.blade.php
+++ b/app/views/admin/manage-admin.blade.php
@@ -1,171 +1,196 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
+@parent
 @stop
 
 @section('content')
 <div class="container">
     <div class="col-md-12">
         @if( Session::has("message"))
-            <div class="row">
-                <div class="alert alert-success alert-dismissible" role="alert">
-                    <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                    {{ Session::get("message") }}
-                </div>
+        <div class="row">
+            <div class="alert alert-success alert-dismissible" role="alert">
+                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                        class="sr-only">Close</span></button>
+                {{ Session::get("message") }}
             </div>
-            {{ Session::forget("message") }}
+        </div>
+        {{ Session::forget("message") }}
         @endif
         <div class="panel-group" id="accordion">
 
-        <!-- Super Admin Users have access to Scigap Administration -->
-          <div class="panel panel-default">
-            <div class="panel-heading">
-              <h4 class="panel-title">
-                <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
-                  Scigap Administration
-                </a>
-              </h4>
-            </div>
-            <div id="collapseOne" class="panel-collapse collapse in">
-                <div class="panel-body">
-                    <h1>Add a User to Admin</h1>
-                    <form action="{{URL::to('/')}}/admin/adduser" method="POST" role="form" enctype="multipart/form-data">
-
-                        <div class="form-group required">
-                            <label for="experiment-name" class="control-label">Enter Username</label>
-                            <input type="text" class="form-control" name="username" id="experiment-name" placeholder="username" autofocus required="required">
-                        </div>
-                        <div class="btn-toolbar">
-                            <input name="add" type="submit" class="btn btn-primary" value="Add User">
-                        </div>   
-                    </form>
+            <!-- Super Admin Users have access to Scigap Administration -->
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
+                            Scigap Administration
+                        </a>
+                    </h4>
                 </div>
-            </div>
-          </div>
-        <!-- Scigap Administration Ends -->
-
-        <!-- Gateway Administration can be accessed by Super Admins and Gateway Admins can access their particular gateway -->
-        <div class="panel panel-default">
-            <div class="panel-heading">
-              <h4 class="panel-title">
-                <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
-                    Gateways Administration
-                </a>
-              </h4>
-            </div>
-            <div id="collapseThree" class="panel-collapse collapse">
-                <div class="panel-body">
-                    <div class="row">
+                <div id="collapseOne" class="panel-collapse collapse in">
+                    <div class="panel-body">
+                        <h1>Add a User to Admin</h1>
 
-                        <div class="col-md-6">
-                            <h3>Existing Gateway Resource Profiles :</h3>
-                        </div>
-                        <div class="col-md-6" style="margin-top:3.5%">
-                            <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name" />
-                        </div>
+                        <form action="{{URL::to('/')}}/admin/adduser" method="POST" role="form"
+                              enctype="multipart/form-data">
+
+                            <div class="form-group required">
+                                <label for="experiment-name" class="control-label">Enter Username</label>
+                                <input type="text" class="form-control" name="username" id="experiment-name"
+                                       placeholder="username" autofocus required="required">
+                            </div>
+                            <div class="btn-toolbar">
+                                <input name="add" type="submit" class="btn btn-primary" value="Add User">
+                            </div>
+                        </form>
                     </div>
-                    <div class="panel-group" id="accordion2">
-                    @foreach( $gatewayProfiles as $indexGP => $gp )
-                        <div class="panel panel-default">
-                            <div class="panel-heading">
-                                <h4 class="panel-title">
-                                    <a class="accordion-toggle collapsed gateway-name" data-toggle="collapse" data-parent="#accordion2" href="#collapse-gateway-{{$indexGP}}">
-                                    {{ $gp->gatewayName }}
-                                    </a>
-                                    <div class="pull-right col-md-2 gateway-options fade">
-                                        <span class="glyphicon glyphicon-pencil edit-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#edit-gateway-block" data-gp-id="{{ $gp->gatewayID }}" data-gp-name="{{ $gp->gatewayName }}" data-gp-desc="{{ $gp->gatewayDescription }}"></span>
-                                        <span class="glyphicon glyphicon-trash delete-gateway" style="cursor:pointer;" data-toggle="modal" data-target="#delete-gateway-block" data-gp-name="{{$gp->gatewayName}}" data-gp-id="{{ $gp->gatewayID }}"></span>
-                                    </div>
-                                </h4>
+                </div>
+            </div>
+            <!-- Scigap Administration Ends -->
+
+            <!-- Gateway Administration can be accessed by Super Admins and Gateway Admins can access their particular gateway -->
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
+                            Gateways Administration
+                        </a>
+                    </h4>
+                </div>
+                <div id="collapseThree" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        <div class="row">
+
+                            <div class="col-md-6">
+                                <h3>Existing Gateway Resource Profiles :</h3>
                             </div>
-                            <div id="collapse-gateway-{{$indexGP}}" class="panel-collapse collapse">
-                                <div class="panel-body">
-                                    <div class="app-interface-block">
-                                        <h5>{{ $gp->gatewayDescription}}</h5>
-                                        <hr/>
-                                        <div class="row">
-                                            <div class="col-md-10">
-                                                <h4><span class="glyphicon glyphicon-plus"></span> Add a user as Admin to this Gateway</h4>
-                                                <form action="{{URL::to('/')}}/admin/addgatewayadmin" method="POST" role="form" enctype="multipart/form-data">
-                                                    <div class="form-group required">
-                                                        <label for="experiment-name" class="control-label">Enter Username</label>
-                                                        <input type="text" class="form-control" name="username" id="experiment-name" placeholder="username" autofocus required="required">
-                                                        <input type="hidden" name="gateway_name" value="{{ $gp->gatewayName }}"/>
-                                                    </div>
-                                                    <div class="btn-toolbar">
-                                                        <input name="add" type="submit" class="btn btn-primary" value="Add Admin"/>
-                                                    </div>   
-                                                </form>
+                            <div class="col-md-6" style="margin-top:3.5%">
+                                <input type="text" class="col-md-12 filterinput" placeholder="Search by Gateway Name"/>
+                            </div>
+                        </div>
+                        <div class="panel-group" id="accordion2">
+                            @foreach( $gatewayProfiles as $indexGP => $gp )
+                            <div class="panel panel-default">
+                                <div class="panel-heading">
+                                    <h4 class="panel-title">
+                                        <a class="accordion-toggle collapsed gateway-name" data-toggle="collapse"
+                                           data-parent="#accordion2" href="#collapse-gateway-{{$indexGP}}">
+                                            {{ $gp->gatewayName }}
+                                        </a>
+
+                                        <div class="pull-right col-md-2 gateway-options fade">
+                                            <span class="glyphicon glyphicon-pencil edit-gateway"
+                                                  style="cursor:pointer;" data-toggle="modal"
+                                                  data-target="#edit-gateway-block" data-gp-id="{{ $gp->gatewayID }}"
+                                                  data-gp-name="{{ $gp->gatewayName }}"
+                                                  data-gp-desc="{{ $gp->gatewayDescription }}"></span>
+                                            <span class="glyphicon glyphicon-trash delete-gateway"
+                                                  style="cursor:pointer;" data-toggle="modal"
+                                                  data-target="#delete-gateway-block"
+                                                  data-gp-name="{{$gp->gatewayName}}"
+                                                  data-gp-id="{{ $gp->gatewayID }}"></span>
+                                        </div>
+                                    </h4>
+                                </div>
+                                <div id="collapse-gateway-{{$indexGP}}" class="panel-collapse collapse">
+                                    <div class="panel-body">
+                                        <div class="app-interface-block">
+                                            <h5>{{ $gp->gatewayDescription}}</h5>
+                                            <hr/>
+                                            <div class="row">
+                                                <div class="col-md-10">
+                                                    <h4><span class="glyphicon glyphicon-plus"></span> Add a user as
+                                                        Admin to this Gateway</h4>
+
+                                                    <form action="{{URL::to('/')}}/admin/addgatewayadmin" method="POST"
+                                                          role="form" enctype="multipart/form-data">
+                                                        <div class="form-group required">
+                                                            <label for="experiment-name" class="control-label">Enter
+                                                                Username</label>
+                                                            <input type="text" class="form-control" name="username"
+                                                                   id="experiment-name" placeholder="username" autofocus
+                                                                   required="required">
+                                                            <input type="hidden" name="gateway_name"
+                                                                   value="{{ $gp->gatewayName }}"/>
+                                                        </div>
+                                                        <div class="btn-toolbar">
+                                                            <input name="add" type="submit" class="btn btn-primary"
+                                                                   value="Add Admin"/>
+                                                        </div>
+                                                    </form>
+                                                </div>
                                             </div>
                                         </div>
                                     </div>
                                 </div>
                             </div>
+                            @endforeach
                         </div>
-                    @endforeach
                     </div>
                 </div>
             </div>
-          </div>
-
-        <!-- Super Admin Users have access to Role Administration -->
-          <div class="panel panel-default">
-            <div class="panel-heading">
-              <h4 class="panel-title">
-                <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
-                  Role Adminstration
-                </a>
-              </h4>
-            </div>
-            <div id="collapseTwo" class="panel-collapse collapse">
-                <div class="panel-body">
-                    <h1>Existing Roles</h1>
-                    <table class="table table-condensed">
-                    @foreach( $roles as $role)
-                        <tr>
-                            <td>{{ $role }}</td>
-                            @if( $role != "admin")
+
+            <!-- Super Admin Users have access to Role Administration -->
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo">
+                            Role Adminstration
+                        </a>
+                    </h4>
+                </div>
+                <div id="collapseTwo" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        <h1>Existing Roles</h1>
+                        <table class="table table-condensed">
+                            @foreach( $roles as $role)
+                            <tr>
+                                <td>{{ $role }}</td>
+                                @if( $role != "admin")
                                 <td><a href=""><span class="glyphicon glyphicon-pencil"></span></a></td>
                                 <td><span class="glyphicon glyphicon-remove"></span></td>
-                            @endif
-                        </tr>
-                    @endforeach
-                    </table>
-                    <h1>Add a new Role</h1>
-                    <form id="role-form" action="{{URL::to('/')}}/admin/addrole" method="POST" role="form" enctype="multipart/form-data">
-                        <div class="form-group form-horizontal required col-md-2">
-                            <label for="experiment-name" class="control-label">Enter Role</label>
-                        </div>
-                        <div class="form-group form-horizontal required col-md-4">
-                            <input type="text" class="form-control input-small role-name" name="role" placeholder="username" autofocus required="required">
-                        </div>
-                        <div class="form-group form-horizontal col-md-4">
-                            <input name="add" type="submit" class="btn btn-primary add-role" value="Add">
-                        </div>   
-                    </form>
-                    <input type="hidden" id="roles" value="{{ htmlentities( json_encode( $roles) ) }}"/>
+                                @endif
+                            </tr>
+                            @endforeach
+                        </table>
+                        <h1>Add a new Role</h1>
+
+                        <form id="role-form" action="{{URL::to('/')}}/admin/addrole" method="POST" role="form"
+                              enctype="multipart/form-data">
+                            <div class="form-group form-horizontal required col-md-2">
+                                <label for="experiment-name" class="control-label">Enter Role</label>
+                            </div>
+                            <div class="form-group form-horizontal required col-md-4">
+                                <input type="text" class="form-control input-small role-name" name="role"
+                                       placeholder="username" autofocus required="required">
+                            </div>
+                            <div class="form-group form-horizontal col-md-4">
+                                <input name="add" type="submit" class="btn btn-primary add-role" value="Add">
+                            </div>
+                        </form>
+                        <input type="hidden" id="roles" value="{{ htmlentities( json_encode( $roles) ) }}"/>
+                    </div>
                 </div>
             </div>
-          </div>
-          <!-- Role Administration complete -->
-
-          <!-- Admins will have access to their settings -->
-          <div class="panel panel-default">
-            <div class="panel-heading">
-              <h4 class="panel-title">
-                <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
-                    Settings
-                </a>
-              </h4>
-            </div>
-            <div id="collapseThree" class="panel-collapse collapse">
-                <div class="panel-body">
-                    some settngs should come here.
+            <!-- Role Administration complete -->
+
+            <!-- Admins will have access to their settings -->
+            <div class="panel panel-default">
+                <div class="panel-heading">
+                    <h4 class="panel-title">
+                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseThree">
+                            Settings
+                        </a>
+                    </h4>
+                </div>
+                <div id="collapseThree" class="panel-collapse collapse">
+                    <div class="panel-body">
+                        some settngs should come here.
+                    </div>
                 </div>
             </div>
-          </div>
-          <!--Settings complete -->
+            <!--Settings complete -->
 
         </div>
     </div>
@@ -175,22 +200,20 @@
 
 
 @section('scripts')
-    @parent
-    <script>
+@parent
+<script>
     // Checking if role already exists.
-    $(".add-role").click( function( e){
+    $(".add-role").click(function (e) {
         e.preventDefault();
-        var roles = $.parseJSON( $("#roles").val() );
-        if( $.inArray( $.trim( $(".role-name").val() ), roles ) != -1 )
-        {
-            console.log( $(this).parent().find(".alert").length );
-            if( ! $(this).parent().parent().find(".alert").length )
-            {
+        var roles = $.parseJSON($("#roles").val());
+        if ($.inArray($.trim($(".role-name").val()), roles) != -1) {
+            console.log($(this).parent().find(".alert").length);
+            if (!$(this).parent().parent().find(".alert").length) {
                 $(this).parent().after("<div class='col-md-12 alert alert-danger'>This role already exists. Please pick another role.</span>");
             }
         }
         else
             $("#role-form").submit();
     });
-    </script>
+</script>
 @stop
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/2fbd9289/app/views/admin/manage-credentials.blade.php
----------------------------------------------------------------------
diff --git a/app/views/admin/manage-credentials.blade.php b/app/views/admin/manage-credentials.blade.php
index 2183739..cebd634 100644
--- a/app/views/admin/manage-credentials.blade.php
+++ b/app/views/admin/manage-credentials.blade.php
@@ -1,164 +1,170 @@
 @extends('layout.basic')
 
 @section('page-header')
-    @parent
-    {{ HTML::style('css/admin.css')}}
+@parent
+{{ HTML::style('css/admin.css')}}
 @stop
 
 @section('content')
 
-    <div id="wrapper">
-        <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
-        @include( 'partials/dashboard-block')
-        <div id="page-wrapper">
-
-            <div class="container-fluid">
-                <div class="col-md-12">
-                    @if( Session::has("message"))
-                        <div class="row">
-                            <div class="alert alert-success alert-dismissible" role="alert">
-                                <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
-                                {{ Session::get("message") }}
-                            </div>
-                        </div>
-                        {{ Session::forget("message") }}
-                    @endif
-
-                    <h1 class="text-center">SSH Keys</h1>
-
-                    <table class="table table-bordered table-condensed">
-                        <tr>
-                            <th class="text-center">
-                                Token</th>
-                            <th class="text-center">Public Key</th>
-                        </tr>
-                        @foreach( $tokens as $token)
-                        <tr>
-                            <td class="role-name">{{ $token }}</td>
-                            <td>
-                                {{ $public-key }}
-                            </td>
-                        </tr>
-                        @endforeach
-                        <tr>
-                            <td>Some token</td>
-                            <td>$ cat ~/.ssh/id_rsa.pub
-ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
-GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
-Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
-t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En
-mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx
-NrRFi9wrf+M7Q== schacon@mylaptop.local</td>
-                        </tr>
-                    </table>
-                    <table class="table">
-                        <tr class="text-center table-condensed">
-                            <td><button class="btn btn-default">Generate a new token</button></td>
-                        </tr>
-                    </table>
-
-                    <div class="row">
-                        <h1 class="text-center">My Proxy Credentials</h1>
-
-                        <div class="col-md-offset-3 col-md-6">
-                            <table class="table table-striped table-condensed">
-                                <tr>
-                                    <td>My Proxy Server</td>
-                                    <td><input type="text" class="form-control" placeholder="" value=""/></td>
-                                </tr>
-                                <tr>
-                                    <td>Username</td>
-                                    <td><input type="text" class="form-control" placeholder="" value=""/></td>
-                                </tr>
-                                <tr>
-                                    <td>Passphrase</td>
-                                    <td><input type="text" class="form-control" placeholder="" value=""/></td>
-                                </tr>
-                            </table>
-                            <table class="table">
-                                <tr class="text-center table-condensed">
-                                    <td><button class="btn btn-default">Submit</button></td>
-                                </tr>
-                            </table>
-                        </div>
+<div id="wrapper">
+    <!-- Sidebar Menu Items - These collapse to the responsive navigation menu on small screens -->
+    @include( 'partials/dashboard-block')
+    <div id="page-wrapper">
+
+        <div class="container-fluid">
+            <div class="col-md-12">
+                @if( Session::has("message"))
+                <div class="row">
+                    <div class="alert alert-success alert-dismissible" role="alert">
+                        <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span
+                                class="sr-only">Close</span></button>
+                        {{ Session::get("message") }}
                     </div>
+                </div>
+                {{ Session::forget("message") }}
+                @endif
+
+                <h1 class="text-center">SSH Keys</h1>
+
+                <table class="table table-bordered table-condensed">
+                    <tr>
+                        <th class="text-center">
+                            Token
+                        </th>
+                        <th class="text-center">Public Key</th>
+                    </tr>
+                    @foreach( $tokens as $token)
+                    <tr>
+                        <td class="role-name">{{ $token }}</td>
+                        <td>
+                            {{ $public-key }}
+                        </td>
+                    </tr>
+                    @endforeach
+                    <tr>
+                        <td>Some token</td>
+                        <td>$ cat ~/.ssh/id_rsa.pub
+                            ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAklOUpkDHrfHY17SbrmTIpNLTGK9Tjom/BWDSU
+                            GPl+nafzlHDTYW7hdI4yZ5ew18JH4JW9jbhUFrviQzM7xlELEVf4h9lFX5QVkbPppSwg0cda3
+                            Pbv7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8V6RjsNAQwdsdMFvSlVK/7XA
+                            t3FaoJoAsncM1Q9x5+3V0Ww68/eIFmb1zuUFljQJKprrX88XypNDvjYNby6vw/Pb0rwert/En
+                            mZ+AW4OZPnTPI89ZPmVMLuayrD2cE86Z/il8b+gw3r3+1nKatmIkjn2so1d01QraTlMqVSsbx
+                            NrRFi9wrf+M7Q== schacon@mylaptop.local
+                        </td>
+                    </tr>
+                </table>
+                <table class="table">
+                    <tr class="text-center table-condensed">
+                        <td>
+                            <button class="btn btn-default">Generate a new token</button>
+                        </td>
+                    </tr>
+                </table>
+
+                <div class="row">
+                    <h1 class="text-center">My Proxy Credentials</h1>
+
+                    <div class="col-md-offset-3 col-md-6">
+                        <table class="table table-striped table-condensed">
+                            <tr>
+                                <td>My Proxy Server</td>
+                                <td><input type="text" class="form-control" placeholder="" value=""/></td>
+                            </tr>
+                            <tr>
+                                <td>Username</td>
+                                <td><input type="text" class="form-control" placeholder="" value=""/></td>
+                            </tr>
+                            <tr>
+                                <td>Passphrase</td>
+                                <td><input type="text" class="form-control" placeholder="" value=""/></td>
+                            </tr>
+                        </table>
+                        <table class="table">
+                            <tr class="text-center table-condensed">
+                                <td>
+                                    <button class="btn btn-default">Submit</button>
+                                </td>
+                            </tr>
+                        </table>
+                    </div>
+                </div>
 
-                    <h1 class="text-center">Amazon Credentials</h1>
+                <h1 class="text-center">Amazon Credentials</h1>
 
-                    <table class="table table-striped table-condensed">
-                        <tr class="text-center">
-                            <td>Under Development</td>
-                        </tr>
-                    </table>
+                <table class="table table-striped table-condensed">
+                    <tr class="text-center">
+                        <td>Under Development</td>
+                    </tr>
+                </table>
 
-                    <h1 class="text-center">OAuth MyProxy</h1>
+                <h1 class="text-center">OAuth MyProxy</h1>
 
-                    <table class="table table-striped table-condensed">
-                        <tr class="text-center">
-                            <td>Under Development</td>
-                        </tr>
-                    </table>
-                </div>
+                <table class="table table-striped table-condensed">
+                    <tr class="text-center">
+                        <td>Under Development</td>
+                    </tr>
+                </table>
             </div>
         </div>
     </div>
+</div>
 
-    <div class="modal fade" id="delete-role-block" tabindex="-1" role="dialog" aria-labelledby="add-modal" aria-hidden="true">
-        <div class="modal-dialog">
+<div class="modal fade" id="delete-role-block" tabindex="-1" role="dialog" aria-labelledby="add-modal"
+     aria-hidden="true">
+    <div class="modal-dialog">
 
-            <form action="{{URL::to('/')}}/admin/deleterole" method="POST">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h3 class="text-center">Delete Role Confirmation</h3>
-                    </div>
-                    <div class="modal-body">
-                        <input type="hidden" class="form-control delete-roleName" name="role"/>
-                        Do you really want to delete the role - <span class="delete-role-name"></span>
-                    </div>
-                    <div class="modal-footer">
-                        <div class="form-group">
-                            <input type="submit" class="btn btn-danger" value="Delete"/>
-                            <input type="button" class="btn btn-default" data-dismiss="modal" value ="Cancel"/>
-                        </div>
+        <form action="{{URL::to('/')}}/admin/deleterole" method="POST">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <h3 class="text-center">Delete Role Confirmation</h3>
+                </div>
+                <div class="modal-body">
+                    <input type="hidden" class="form-control delete-roleName" name="role"/>
+                    Do you really want to delete the role - <span class="delete-role-name"></span>
+                </div>
+                <div class="modal-footer">
+                    <div class="form-group">
+                        <input type="submit" class="btn btn-danger" value="Delete"/>
+                        <input type="button" class="btn btn-default" data-dismiss="modal" value="Cancel"/>
                     </div>
                 </div>
+            </div>
 
-            </form>
+        </form>
 
 
-        </div>
     </div>
+</div>
 
 
 @stop
 
 @section('scripts')
-    @parent
-    <script>
-        $(".toggle-add-role").click( function(){
-            $(".add-role").slideDown();
-        });
-
-        $(".edit-role-name").click( function(){
-            var roleNameSpace = $(this).parent().parent().find(".role-name");
-            if( roleNameSpace.find(".edit-role-form").length )
-            {
-                roleNameSpace.html( roleNameSpace.find(".original-role-name").val() );
-            }
-            else
-            {
-                var role = roleNameSpace.html();
-                roleNameSpace.html( $(".edit-role").html() );
-                roleNameSpace.find(".original-role-name").val( role );
-                roleNameSpace.find(".new-role-name").val( role );
-            }
-        });
-
-        $(".delete-role").click( function(){
-            $("#delete-role-block").modal("show");
-            var roleName = $(this).parent().parent().find(".role-name").html();
-            $(".delete-role-name").html(roleName);
-            $(".delete-roleName").val(roleName);
-        })
-    </script>
+@parent
+<script>
+    $(".toggle-add-role").click(function () {
+        $(".add-role").slideDown();
+    });
+
+    $(".edit-role-name").click(function () {
+        var roleNameSpace = $(this).parent().parent().find(".role-name");
+        if (roleNameSpace.find(".edit-role-form").length) {
+            roleNameSpace.html(roleNameSpace.find(".original-role-name").val());
+        }
+        else {
+            var role = roleNameSpace.html();
+            roleNameSpace.html($(".edit-role").html());
+            roleNameSpace.find(".original-role-name").val(role);
+            roleNameSpace.find(".new-role-name").val(role);
+        }
+    });
+
+    $(".delete-role").click(function () {
+        $("#delete-role-block").modal("show");
+        var roleName = $(this).parent().parent().find(".role-name").html();
+        $(".delete-role-name").html(roleName);
+        $(".delete-roleName").val(roleName);
+    })
+</script>
 @stop
\ No newline at end of file