Repository: airavata-php-gateway Updated Branches: refs/heads/develop bfff10f58 -> 6aacbc8ed
using replica model uris 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/6aacbc8e Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/6aacbc8e Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/6aacbc8e Branch: refs/heads/develop Commit: 6aacbc8edc9d26d36c3943a3ec23e6cdd875b2fd Parents: bfff10f Author: scnakandala <[email protected]> Authored: Wed Mar 23 13:46:24 2016 -0400 Committer: scnakandala <[email protected]> Committed: Wed Mar 23 13:46:24 2016 -0400 ---------------------------------------------------------------------- app/libraries/ExperimentUtilities.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/6aacbc8e/app/libraries/ExperimentUtilities.php ---------------------------------------------------------------------- diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php index 978e5ec..06b90a4 100644 --- a/app/libraries/ExperimentUtilities.php +++ b/app/libraries/ExperimentUtilities.php @@ -306,11 +306,21 @@ class ExperimentUtilities $dataProductModel = new DataProductModel(); $dataProductModel->gatewayId = Config::get("pga_config.airavata")["gateway-id"]; $dataProductModel->ownerName = Session::get("username"); - - $hostName = $_SERVER['SERVER_NAME']; - $experimentInput->value = 'file://' . $hostName . ':' . $filePath; - - + $dataProductModel->productName = basename($filePath); + $logicalPath = str_replace(Config::get("pga_config.airavata")["experiment-data-absolute-path"],"", $filePath); + $dataProductModel->logicalPath = $logicalPath; + $dataProductModel->dataProductType = DataProductType::FILE; + + $dataReplicationModel = new DataReplicaLocationModel(); + $dataReplicationModel->storageResourceId = Config::get("pga_config.airavata")["gateway-data-store-resource-id"]; + $dataReplicationModel->replicaName = basename($filePath) . "-gateway-datastore-copy"; + $dataReplicationModel->replicaLocationCategory = ReplicaLocationCategory::GATEWAY_DATA_STORE; + $dataReplicationModel->replicaPersistentType = ReplicaPersistentType::TRANSIENT; + $dataReplicationModel->filePath = $filePath; + + $dataProductModel->replicaLocations[] = $dataReplicationModel; + $uri = Airavata::registerDataProduct(Session::get('authz-token'), $dataReplicationModel); + $experimentInput->value = $uri; } else { CommonUtilities::print_error_message('I cannot accept this input type yet!'); }
