Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0294217CAF for ; Thu, 12 Mar 2015 03:54:38 +0000 (UTC) Received: (qmail 44929 invoked by uid 500); 12 Mar 2015 03:54:37 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 44811 invoked by uid 500); 12 Mar 2015 03:54:37 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 42597 invoked by uid 99); 12 Mar 2015 03:54:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Mar 2015 03:54:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4DB55E18C7; Thu, 12 Mar 2015 03:54:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Date: Thu, 12 Mar 2015 03:55:15 -0000 Message-Id: In-Reply-To: <0e325e81e187438d858fb11006622184@git.apache.org> References: <0e325e81e187438d858fb11006622184@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [43/51] [partial] airavata-php-gateway git commit: importing PGA into new repo - details are discussed at AIRAVATA-1627 http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/a325e292/app/libraries/Airavata/Model/Types.php ---------------------------------------------------------------------- diff --git a/app/libraries/Airavata/Model/Types.php b/app/libraries/Airavata/Model/Types.php new file mode 100644 index 0000000..4e89132 --- /dev/null +++ b/app/libraries/Airavata/Model/Types.php @@ -0,0 +1,250 @@ + array( + 'var' => 'templateId', + 'type' => TType::STRING, + ), + 2 => array( + 'var' => 'name', + 'type' => TType::STRING, + ), + 3 => array( + 'var' => 'graph', + 'type' => TType::STRING, + ), + 4 => array( + 'var' => 'image', + 'type' => TType::STRING, + ), + 5 => array( + 'var' => 'workflowInputs', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => '\Airavata\Model\AppCatalog\AppInterface\InputDataObjectType', + ), + ), + 6 => array( + 'var' => 'workflowOutputs', + 'type' => TType::LST, + 'etype' => TType::STRUCT, + 'elem' => array( + 'type' => TType::STRUCT, + 'class' => '\Airavata\Model\AppCatalog\AppInterface\OutputDataObjectType', + ), + ), + ); + } + if (is_array($vals)) { + if (isset($vals['templateId'])) { + $this->templateId = $vals['templateId']; + } + if (isset($vals['name'])) { + $this->name = $vals['name']; + } + if (isset($vals['graph'])) { + $this->graph = $vals['graph']; + } + if (isset($vals['image'])) { + $this->image = $vals['image']; + } + if (isset($vals['workflowInputs'])) { + $this->workflowInputs = $vals['workflowInputs']; + } + if (isset($vals['workflowOutputs'])) { + $this->workflowOutputs = $vals['workflowOutputs']; + } + } + } + + public function getName() { + return 'Workflow'; + } + + public function read($input) + { + $xfer = 0; + $fname = null; + $ftype = 0; + $fid = 0; + $xfer += $input->readStructBegin($fname); + while (true) + { + $xfer += $input->readFieldBegin($fname, $ftype, $fid); + if ($ftype == TType::STOP) { + break; + } + switch ($fid) + { + case 1: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->templateId); + } else { + $xfer += $input->skip($ftype); + } + break; + case 2: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->name); + } else { + $xfer += $input->skip($ftype); + } + break; + case 3: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->graph); + } else { + $xfer += $input->skip($ftype); + } + break; + case 4: + if ($ftype == TType::STRING) { + $xfer += $input->readString($this->image); + } else { + $xfer += $input->skip($ftype); + } + break; + case 5: + if ($ftype == TType::LST) { + $this->workflowInputs = array(); + $_size0 = 0; + $_etype3 = 0; + $xfer += $input->readListBegin($_etype3, $_size0); + for ($_i4 = 0; $_i4 < $_size0; ++$_i4) + { + $elem5 = null; + $elem5 = new \Airavata\Model\AppCatalog\AppInterface\InputDataObjectType(); + $xfer += $elem5->read($input); + $this->workflowInputs []= $elem5; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + case 6: + if ($ftype == TType::LST) { + $this->workflowOutputs = array(); + $_size6 = 0; + $_etype9 = 0; + $xfer += $input->readListBegin($_etype9, $_size6); + for ($_i10 = 0; $_i10 < $_size6; ++$_i10) + { + $elem11 = null; + $elem11 = new \Airavata\Model\AppCatalog\AppInterface\OutputDataObjectType(); + $xfer += $elem11->read($input); + $this->workflowOutputs []= $elem11; + } + $xfer += $input->readListEnd(); + } else { + $xfer += $input->skip($ftype); + } + break; + default: + $xfer += $input->skip($ftype); + break; + } + $xfer += $input->readFieldEnd(); + } + $xfer += $input->readStructEnd(); + return $xfer; + } + + public function write($output) { + $xfer = 0; + $xfer += $output->writeStructBegin('Workflow'); + if ($this->templateId !== null) { + $xfer += $output->writeFieldBegin('templateId', TType::STRING, 1); + $xfer += $output->writeString($this->templateId); + $xfer += $output->writeFieldEnd(); + } + if ($this->name !== null) { + $xfer += $output->writeFieldBegin('name', TType::STRING, 2); + $xfer += $output->writeString($this->name); + $xfer += $output->writeFieldEnd(); + } + if ($this->graph !== null) { + $xfer += $output->writeFieldBegin('graph', TType::STRING, 3); + $xfer += $output->writeString($this->graph); + $xfer += $output->writeFieldEnd(); + } + if ($this->image !== null) { + $xfer += $output->writeFieldBegin('image', TType::STRING, 4); + $xfer += $output->writeString($this->image); + $xfer += $output->writeFieldEnd(); + } + if ($this->workflowInputs !== null) { + if (!is_array($this->workflowInputs)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('workflowInputs', TType::LST, 5); + { + $output->writeListBegin(TType::STRUCT, count($this->workflowInputs)); + { + foreach ($this->workflowInputs as $iter12) + { + $xfer += $iter12->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + if ($this->workflowOutputs !== null) { + if (!is_array($this->workflowOutputs)) { + throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA); + } + $xfer += $output->writeFieldBegin('workflowOutputs', TType::LST, 6); + { + $output->writeListBegin(TType::STRUCT, count($this->workflowOutputs)); + { + foreach ($this->workflowOutputs as $iter13) + { + $xfer += $iter13->write($output); + } + } + $output->writeListEnd(); + } + $xfer += $output->writeFieldEnd(); + } + $xfer += $output->writeFieldStop(); + $xfer += $output->writeStructEnd(); + return $xfer; + } + +} + +$GLOBALS['workflowDataModel_CONSTANTS']['DEFAULT_ID'] = "DO_NOT_SET_AT_CLIENTS"; + +