コード例 #1
0
 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) {
         if (Config::get('pga_config.airavata')['enable-app-catalog-cache']) {
             if (Cache::has('APP-' . $appInterfaceValues["app-interface-id"])) {
                 Cache::forget('APP-' . $appInterfaceValues["app-interface-id"]);
             }
         }
         Airavata::updateApplicationInterface(Session::get('authz-token'), $appInterfaceValues["app-interface-id"], $appInterface);
     } else {
         Airavata::getApplicationInterface(Session::get('authz-token'), Airavata::registerApplicationInterface(Session::get('authz-token'), Session::get("gateway_id"), $appInterface));
     }
     //print_r( "App interface has been created.");
 }