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.");
	}
 /**
  * Get the interface for the application with the given ID
  * @param $id
  * @return null
  */
 public static function get_application_interface($id)
 {
     $applicationInterface = null;
     try {
         if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
             if (Cache::has('APP-' . $id)) {
                 return Cache::get('APP-' . $id);
             } else {
                 $applicationInterface = Airavata::getApplicationInterface(Session::get('authz-token'), $id);
                 Cache::put('APP-' . $id, $applicationInterface, Config::get('pga_config.airavata')['app-catalog-cache-duration']);
                 return $applicationInterface;
             }
         } else {
             return $applicationInterface = Airavata::getApplicationInterface(Session::get('authz-token'), $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>');
     } catch (Exception $ex) {
         return null;
     }
 }
/**
 * 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;
}