You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2017/06/11 20:25:30 UTC
[01/12] airavata-php-gateway git commit: AIRAVATA-2316 Update
Airavata API thrift stubs
Repository: airavata-php-gateway
Updated Branches:
refs/heads/keycloak-integration d02166877 -> 3f99eb644
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/848d72dc/app/libraries/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/API/Airavata.php b/app/libraries/Airavata/API/Airavata.php
index ae27035..e1032be 100644
--- a/app/libraries/Airavata/API/Airavata.php
+++ b/app/libraries/Airavata/API/Airavata.php
@@ -4095,6 +4095,181 @@ interface AiravataIf {
* @throws \Airavata\API\Error\AuthorizationException
*/
public function getAllGroupsUserBelongs(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param \Airavata\Model\User\UserProfile $userProfile
+ * @return string
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function addUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userProfile);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param \Airavata\Model\User\UserProfile $userProfile
+ * @return bool
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function updateUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userProfile);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param string $userId
+ * @param string $gatewayId
+ * @return \Airavata\Model\User\UserProfile * A structure holding the user profile and its child models.
+ * *
+ * * Notes:
+ * * The model does not include passwords as it is assumed an external identity provider is used to authenticate user.
+ * * References:
+ * * NSF Demographic Information - http://www.nsf.gov/pubs/2000/00form1225/00form1225.doc
+ * * LDAP Schema - https://tools.ietf.org/html/rfc4519
+ * * SCIM 2.0 - https://tools.ietf.org/html/rfc7643
+ * *
+ * * userModelVersion:
+ * * Version number of profile
+ * *
+ * * airavataInternalUserId:
+ * * internal to Airavata, not intended to be used outside of the Airavata platform or possibly by gateways
+ * * (that is, never shown to users), never reassigned, REQUIRED
+ * *
+ * * userId:
+ * * Externally assertable unique identifier. SAML (primarly in higher education, academic) tends to keep
+ * * user name less opaque. OpenID Connect maintains them to be opaque.
+ * *
+ * * emails:
+ * * Email identifier are Verified, REQUIRED and MULTIVALUED
+ * *
+ * * userName:
+ * * Name-based identifiers can be multivalues. To keep it simple, Airavata will make it a string.
+ * * In the future these can be enumerated as:
+ * * Official name (as asserted possibly by some external identity provider)
+ * * Prefered name (as asserted or suggested by user directly)
+ * * Components:
+ * * givenName
+ * * surname (familyName)
+ * * displayName (often asserted by user to handle things like middle names, suffix, prefix, and the like)
+ * *
+ * * orcidId: ORCID ID - http://orcid.org/about/what-is-orcid)
+ * *
+ * * phones: Telephone MULTIVALUED
+ * *
+ * * country: Country of Residance
+ * *
+ * * nationality Countries of citizenship
+ * *
+ * * comments:
+ * * Free-form information (treated as opaque by Airavata and simply passed to resource).
+ * *
+ * * labeledURI:
+ * * Google Scholar, Web of Science, ACS, e.t.c
+ * *
+ * * timeZone:
+ * * User’s preferred timezone - IANA Timezone Databases - http://www.iana.org/time-zones.
+ * *
+ *
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function getUserProfileById(\Airavata\Model\Security\AuthzToken $authzToken, $userId, $gatewayId);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param string $userId
+ * @return bool
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function deleteUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, $userId);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param string $gatewayId
+ * @param int $offset
+ * @param int $limit
+ * @return \Airavata\Model\User\UserProfile[]
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function getAllUserProfilesInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $offset, $limit);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param string $userName
+ * @param string $gatewayId
+ * @return \Airavata\Model\User\UserProfile * A structure holding the user profile and its child models.
+ * *
+ * * Notes:
+ * * The model does not include passwords as it is assumed an external identity provider is used to authenticate user.
+ * * References:
+ * * NSF Demographic Information - http://www.nsf.gov/pubs/2000/00form1225/00form1225.doc
+ * * LDAP Schema - https://tools.ietf.org/html/rfc4519
+ * * SCIM 2.0 - https://tools.ietf.org/html/rfc7643
+ * *
+ * * userModelVersion:
+ * * Version number of profile
+ * *
+ * * airavataInternalUserId:
+ * * internal to Airavata, not intended to be used outside of the Airavata platform or possibly by gateways
+ * * (that is, never shown to users), never reassigned, REQUIRED
+ * *
+ * * userId:
+ * * Externally assertable unique identifier. SAML (primarly in higher education, academic) tends to keep
+ * * user name less opaque. OpenID Connect maintains them to be opaque.
+ * *
+ * * emails:
+ * * Email identifier are Verified, REQUIRED and MULTIVALUED
+ * *
+ * * userName:
+ * * Name-based identifiers can be multivalues. To keep it simple, Airavata will make it a string.
+ * * In the future these can be enumerated as:
+ * * Official name (as asserted possibly by some external identity provider)
+ * * Prefered name (as asserted or suggested by user directly)
+ * * Components:
+ * * givenName
+ * * surname (familyName)
+ * * displayName (often asserted by user to handle things like middle names, suffix, prefix, and the like)
+ * *
+ * * orcidId: ORCID ID - http://orcid.org/about/what-is-orcid)
+ * *
+ * * phones: Telephone MULTIVALUED
+ * *
+ * * country: Country of Residance
+ * *
+ * * nationality Countries of citizenship
+ * *
+ * * comments:
+ * * Free-form information (treated as opaque by Airavata and simply passed to resource).
+ * *
+ * * labeledURI:
+ * * Google Scholar, Web of Science, ACS, e.t.c
+ * *
+ * * timeZone:
+ * * User’s preferred timezone - IANA Timezone Databases - http://www.iana.org/time-zones.
+ * *
+ *
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function getUserProfileByName(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId);
+ /**
+ * @param \Airavata\Model\Security\AuthzToken $authzToken
+ * @param string $userName
+ * @param string $gatewayId
+ * @return bool
+ * @throws \Airavata\API\Error\InvalidRequestException
+ * @throws \Airavata\API\Error\AiravataClientException
+ * @throws \Airavata\API\Error\AiravataSystemException
+ * @throws \Airavata\API\Error\AuthorizationException
+ */
+ public function doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId);
}
class AiravataClient implements \Airavata\API\AiravataIf {
@@ -15055,6 +15230,459 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("getAllGroupsUserBelongs failed: unknown result");
}
+ public function addUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userProfile)
+ {
+ $this->send_addUserProfile($authzToken, $userProfile);
+ return $this->recv_addUserProfile();
+ }
+
+ public function send_addUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userProfile)
+ {
+ $args = new \Airavata\API\Airavata_addUserProfile_args();
+ $args->authzToken = $authzToken;
+ $args->userProfile = $userProfile;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'addUserProfile', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('addUserProfile', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_addUserProfile()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_addUserProfile_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_addUserProfile_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("addUserProfile failed: unknown result");
+ }
+
+ public function updateUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userProfile)
+ {
+ $this->send_updateUserProfile($authzToken, $userProfile);
+ return $this->recv_updateUserProfile();
+ }
+
+ public function send_updateUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, \Airavata\Model\User\UserProfile $userProfile)
+ {
+ $args = new \Airavata\API\Airavata_updateUserProfile_args();
+ $args->authzToken = $authzToken;
+ $args->userProfile = $userProfile;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'updateUserProfile', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('updateUserProfile', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_updateUserProfile()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_updateUserProfile_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_updateUserProfile_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("updateUserProfile failed: unknown result");
+ }
+
+ public function getUserProfileById(\Airavata\Model\Security\AuthzToken $authzToken, $userId, $gatewayId)
+ {
+ $this->send_getUserProfileById($authzToken, $userId, $gatewayId);
+ return $this->recv_getUserProfileById();
+ }
+
+ public function send_getUserProfileById(\Airavata\Model\Security\AuthzToken $authzToken, $userId, $gatewayId)
+ {
+ $args = new \Airavata\API\Airavata_getUserProfileById_args();
+ $args->authzToken = $authzToken;
+ $args->userId = $userId;
+ $args->gatewayId = $gatewayId;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'getUserProfileById', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('getUserProfileById', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_getUserProfileById()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getUserProfileById_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_getUserProfileById_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("getUserProfileById failed: unknown result");
+ }
+
+ public function deleteUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, $userId)
+ {
+ $this->send_deleteUserProfile($authzToken, $userId);
+ return $this->recv_deleteUserProfile();
+ }
+
+ public function send_deleteUserProfile(\Airavata\Model\Security\AuthzToken $authzToken, $userId)
+ {
+ $args = new \Airavata\API\Airavata_deleteUserProfile_args();
+ $args->authzToken = $authzToken;
+ $args->userId = $userId;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'deleteUserProfile', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('deleteUserProfile', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_deleteUserProfile()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_deleteUserProfile_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_deleteUserProfile_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("deleteUserProfile failed: unknown result");
+ }
+
+ public function getAllUserProfilesInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $offset, $limit)
+ {
+ $this->send_getAllUserProfilesInGateway($authzToken, $gatewayId, $offset, $limit);
+ return $this->recv_getAllUserProfilesInGateway();
+ }
+
+ public function send_getAllUserProfilesInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $offset, $limit)
+ {
+ $args = new \Airavata\API\Airavata_getAllUserProfilesInGateway_args();
+ $args->authzToken = $authzToken;
+ $args->gatewayId = $gatewayId;
+ $args->offset = $offset;
+ $args->limit = $limit;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'getAllUserProfilesInGateway', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('getAllUserProfilesInGateway', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_getAllUserProfilesInGateway()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getAllUserProfilesInGateway_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_getAllUserProfilesInGateway_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("getAllUserProfilesInGateway failed: unknown result");
+ }
+
+ public function getUserProfileByName(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+ {
+ $this->send_getUserProfileByName($authzToken, $userName, $gatewayId);
+ return $this->recv_getUserProfileByName();
+ }
+
+ public function send_getUserProfileByName(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+ {
+ $args = new \Airavata\API\Airavata_getUserProfileByName_args();
+ $args->authzToken = $authzToken;
+ $args->userName = $userName;
+ $args->gatewayId = $gatewayId;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'getUserProfileByName', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('getUserProfileByName', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_getUserProfileByName()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getUserProfileByName_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_getUserProfileByName_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("getUserProfileByName failed: unknown result");
+ }
+
+ public function doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+ {
+ $this->send_doesUserProfileExist($authzToken, $userName, $gatewayId);
+ return $this->recv_doesUserProfileExist();
+ }
+
+ public function send_doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+ {
+ $args = new \Airavata\API\Airavata_doesUserProfileExist_args();
+ $args->authzToken = $authzToken;
+ $args->userName = $userName;
+ $args->gatewayId = $gatewayId;
+ $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
+ if ($bin_accel)
+ {
+ thrift_protocol_write_binary($this->output_, 'doesUserProfileExist', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
+ }
+ else
+ {
+ $this->output_->writeMessageBegin('doesUserProfileExist', TMessageType::CALL, $this->seqid_);
+ $args->write($this->output_);
+ $this->output_->writeMessageEnd();
+ $this->output_->getTransport()->flush();
+ }
+ }
+
+ public function recv_doesUserProfileExist()
+ {
+ $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
+ if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_doesUserProfileExist_result', $this->input_->isStrictRead());
+ else
+ {
+ $rseqid = 0;
+ $fname = null;
+ $mtype = 0;
+
+ $this->input_->readMessageBegin($fname, $mtype, $rseqid);
+ if ($mtype == TMessageType::EXCEPTION) {
+ $x = new TApplicationException();
+ $x->read($this->input_);
+ $this->input_->readMessageEnd();
+ throw $x;
+ }
+ $result = new \Airavata\API\Airavata_doesUserProfileExist_result();
+ $result->read($this->input_);
+ $this->input_->readMessageEnd();
+ }
+ if ($result->success !== null) {
+ return $result->success;
+ }
+ if ($result->ire !== null) {
+ throw $result->ire;
+ }
+ if ($result->ace !== null) {
+ throw $result->ace;
+ }
+ if ($result->ase !== null) {
+ throw $result->ase;
+ }
+ if ($result->ae !== null) {
+ throw $result->ae;
+ }
+ throw new \Exception("doesUserProfileExist failed: unknown result");
+ }
+
}
// HELPER FUNCTIONS AND STRUCTURES
@@ -28034,14 +28662,2349 @@ class Airavata_launchExperiment_args {
break;
case 2:
if ($ftype == TType::STRING) {
- $xfer += $input->readString($this->airavataExperimentId);
+ $xfer += $input->readString($this->airavataExperimentId);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->gatewayId);
+ } 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('Airavata_launchExperiment_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->airavataExperimentId !== null) {
+ $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2);
+ $xfer += $output->writeString($this->airavataExperimentId);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->gatewayId !== null) {
+ $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
+ $xfer += $output->writeString($this->gatewayId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_launchExperiment_result {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_launchExperiment_result';
+ }
+
+ 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::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } 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('Airavata_launchExperiment_result');
+ if ($this->ire !== null) {
+ $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+ $xfer += $this->ire->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->enf !== null) {
+ $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+ $xfer += $this->enf->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ace !== null) {
+ $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+ $xfer += $this->ace->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ase !== null) {
+ $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+ $xfer += $this->ase->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ae !== null) {
+ $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+ $xfer += $this->ae->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getExperimentStatus_args {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
+ * @var string
+ */
+ public $airavataExperimentId = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
+ 'var' => 'airavataExperimentId',
+ 'type' => TType::STRING,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
+ if (isset($vals['airavataExperimentId'])) {
+ $this->airavataExperimentId = $vals['airavataExperimentId'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getExperimentStatus_args';
+ }
+
+ 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::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->airavataExperimentId);
+ } 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('Airavata_getExperimentStatus_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->airavataExperimentId !== null) {
+ $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2);
+ $xfer += $output->writeString($this->airavataExperimentId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getExperimentStatus_result {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Status\ExperimentStatus
+ */
+ public $success = null;
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 0 => array(
+ 'var' => 'success',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Status\ExperimentStatus',
+ ),
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['success'])) {
+ $this->success = $vals['success'];
+ }
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getExperimentStatus_result';
+ }
+
+ 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 0:
+ if ($ftype == TType::STRUCT) {
+ $this->success = new \Airavata\Model\Status\ExperimentStatus();
+ $xfer += $this->success->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } 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('Airavata_getExperimentStatus_result');
+ if ($this->success !== null) {
+ if (!is_object($this->success)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
+ $xfer += $this->success->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ire !== null) {
+ $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+ $xfer += $this->ire->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->enf !== null) {
+ $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+ $xfer += $this->enf->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ace !== null) {
+ $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+ $xfer += $this->ace->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ase !== null) {
+ $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+ $xfer += $this->ase->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ae !== null) {
+ $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+ $xfer += $this->ae->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getExperimentOutputs_args {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
+ * @var string
+ */
+ public $airavataExperimentId = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
+ 'var' => 'airavataExperimentId',
+ 'type' => TType::STRING,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
+ if (isset($vals['airavataExperimentId'])) {
+ $this->airavataExperimentId = $vals['airavataExperimentId'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getExperimentOutputs_args';
+ }
+
+ 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::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->airavataExperimentId);
+ } 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('Airavata_getExperimentOutputs_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->airavataExperimentId !== null) {
+ $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2);
+ $xfer += $output->writeString($this->airavataExperimentId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getExperimentOutputs_result {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Application\Io\OutputDataObjectType[]
+ */
+ public $success = null;
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 0 => array(
+ 'var' => 'success',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Application\Io\OutputDataObjectType',
+ ),
+ ),
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['success'])) {
+ $this->success = $vals['success'];
+ }
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getExperimentOutputs_result';
+ }
+
+ 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 0:
+ if ($ftype == TType::LST) {
+ $this->success = array();
+ $_size106 = 0;
+ $_etype109 = 0;
+ $xfer += $input->readListBegin($_etype109, $_size106);
+ for ($_i110 = 0; $_i110 < $_size106; ++$_i110)
+ {
+ $elem111 = null;
+ $elem111 = new \Airavata\Model\Application\Io\OutputDataObjectType();
+ $xfer += $elem111->read($input);
+ $this->success []= $elem111;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } 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('Airavata_getExperimentOutputs_result');
+ if ($this->success !== null) {
+ if (!is_array($this->success)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('success', TType::LST, 0);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->success));
+ {
+ foreach ($this->success as $iter112)
+ {
+ $xfer += $iter112->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ire !== null) {
+ $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+ $xfer += $this->ire->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->enf !== null) {
+ $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+ $xfer += $this->enf->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ace !== null) {
+ $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+ $xfer += $this->ace->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ase !== null) {
+ $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+ $xfer += $this->ase->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ae !== null) {
+ $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+ $xfer += $this->ae->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getIntermediateOutputs_args {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
+ * @var string
+ */
+ public $airavataExperimentId = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
+ 'var' => 'airavataExperimentId',
+ 'type' => TType::STRING,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
+ if (isset($vals['airavataExperimentId'])) {
+ $this->airavataExperimentId = $vals['airavataExperimentId'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getIntermediateOutputs_args';
+ }
+
+ 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::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->airavataExperimentId);
+ } 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('Airavata_getIntermediateOutputs_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->airavataExperimentId !== null) {
+ $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2);
+ $xfer += $output->writeString($this->airavataExperimentId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getIntermediateOutputs_result {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Application\Io\OutputDataObjectType[]
+ */
+ public $success = null;
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 0 => array(
+ 'var' => 'success',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Application\Io\OutputDataObjectType',
+ ),
+ ),
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['success'])) {
+ $this->success = $vals['success'];
+ }
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getIntermediateOutputs_result';
+ }
+
+ 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 0:
+ if ($ftype == TType::LST) {
+ $this->success = array();
+ $_size113 = 0;
+ $_etype116 = 0;
+ $xfer += $input->readListBegin($_etype116, $_size113);
+ for ($_i117 = 0; $_i117 < $_size113; ++$_i117)
+ {
+ $elem118 = null;
+ $elem118 = new \Airavata\Model\Application\Io\OutputDataObjectType();
+ $xfer += $elem118->read($input);
+ $this->success []= $elem118;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } 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('Airavata_getIntermediateOutputs_result');
+ if ($this->success !== null) {
+ if (!is_array($this->success)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('success', TType::LST, 0);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->success));
+ {
+ foreach ($this->success as $iter119)
+ {
+ $xfer += $iter119->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ire !== null) {
+ $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+ $xfer += $this->ire->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->enf !== null) {
+ $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+ $xfer += $this->enf->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ace !== null) {
+ $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+ $xfer += $this->ace->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ase !== null) {
+ $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+ $xfer += $this->ase->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ae !== null) {
+ $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+ $xfer += $this->ae->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getJobStatuses_args {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
+ * @var string
+ */
+ public $airavataExperimentId = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
+ 'var' => 'airavataExperimentId',
+ 'type' => TType::STRING,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
+ if (isset($vals['airavataExperimentId'])) {
+ $this->airavataExperimentId = $vals['airavataExperimentId'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getJobStatuses_args';
+ }
+
+ 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::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->airavataExperimentId);
+ } 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('Airavata_getJobStatuses_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->airavataExperimentId !== null) {
+ $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2);
+ $xfer += $output->writeString($this->airavataExperimentId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getJobStatuses_result {
+ static $_TSPEC;
+
+ /**
+ * @var array
+ */
+ public $success = null;
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 0 => array(
+ 'var' => 'success',
+ 'type' => TType::MAP,
+ 'ktype' => TType::STRING,
+ 'vtype' => TType::STRUCT,
+ 'key' => array(
+ 'type' => TType::STRING,
+ ),
+ 'val' => array(
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Status\JobStatus',
+ ),
+ ),
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['success'])) {
+ $this->success = $vals['success'];
+ }
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getJobStatuses_result';
+ }
+
+ 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 0:
+ if ($ftype == TType::MAP) {
+ $this->success = array();
+ $_size120 = 0;
+ $_ktype121 = 0;
+ $_vtype122 = 0;
+ $xfer += $input->readMapBegin($_ktype121, $_vtype122, $_size120);
+ for ($_i124 = 0; $_i124 < $_size120; ++$_i124)
+ {
+ $key125 = '';
+ $val126 = new \Airavata\Model\Status\JobStatus();
+ $xfer += $input->readString($key125);
+ $val126 = new \Airavata\Model\Status\JobStatus();
+ $xfer += $val126->read($input);
+ $this->success[$key125] = $val126;
+ }
+ $xfer += $input->readMapEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } 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('Airavata_getJobStatuses_result');
+ if ($this->success !== null) {
+ if (!is_array($this->success)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('success', TType::MAP, 0);
+ {
+ $output->writeMapBegin(TType::STRING, TType::STRUCT, count($this->success));
+ {
+ foreach ($this->success as $kiter127 => $viter128)
+ {
+ $xfer += $output->writeString($kiter127);
+ $xfer += $viter128->write($output);
+ }
+ }
+ $output->writeMapEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ire !== null) {
+ $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+ $xfer += $this->ire->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->enf !== null) {
+ $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+ $xfer += $this->enf->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ace !== null) {
+ $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+ $xfer += $this->ace->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ase !== null) {
+ $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+ $xfer += $this->ase->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ae !== null) {
+ $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+ $xfer += $this->ae->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getJobDetails_args {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
+ * @var string
+ */
+ public $airavataExperimentId = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
+ 'var' => 'airavataExperimentId',
+ 'type' => TType::STRING,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
+ if (isset($vals['airavataExperimentId'])) {
+ $this->airavataExperimentId = $vals['airavataExperimentId'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getJobDetails_args';
+ }
+
+ 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::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->airavataExperimentId);
+ } 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('Airavata_getJobDetails_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->airavataExperimentId !== null) {
+ $xfer += $output->writeFieldBegin('airavataExperimentId', TType::STRING, 2);
+ $xfer += $output->writeString($this->airavataExperimentId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_getJobDetails_result {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Job\JobModel[]
+ */
+ public $success = null;
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 0 => array(
+ 'var' => 'success',
+ 'type' => TType::LST,
+ 'etype' => TType::STRUCT,
+ 'elem' => array(
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Job\JobModel',
+ ),
+ ),
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['success'])) {
+ $this->success = $vals['success'];
+ }
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_getJobDetails_result';
+ }
+
+ 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 0:
+ if ($ftype == TType::LST) {
+ $this->success = array();
+ $_size129 = 0;
+ $_etype132 = 0;
+ $xfer += $input->readListBegin($_etype132, $_size129);
+ for ($_i133 = 0; $_i133 < $_size129; ++$_i133)
+ {
+ $elem134 = null;
+ $elem134 = new \Airavata\Model\Job\JobModel();
+ $xfer += $elem134->read($input);
+ $this->success []= $elem134;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } 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('Airavata_getJobDetails_result');
+ if ($this->success !== null) {
+ if (!is_array($this->success)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('success', TType::LST, 0);
+ {
+ $output->writeListBegin(TType::STRUCT, count($this->success));
+ {
+ foreach ($this->success as $iter135)
+ {
+ $xfer += $iter135->write($output);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ire !== null) {
+ $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
+ $xfer += $this->ire->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->enf !== null) {
+ $xfer += $output->writeFieldBegin('enf', TType::STRUCT, 2);
+ $xfer += $this->enf->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ace !== null) {
+ $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 3);
+ $xfer += $this->ace->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ase !== null) {
+ $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 4);
+ $xfer += $this->ase->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->ae !== null) {
+ $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 5);
+ $xfer += $this->ae->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_cloneExperiment_args {
+ static $_TSPEC;
+
+ /**
+ * @var \Airavata\Model\Security\AuthzToken
+ */
+ public $authzToken = null;
+ /**
+ * @var string
+ */
+ public $existingExperimentID = null;
+ /**
+ * @var string
+ */
+ public $newExperimentName = null;
+ /**
+ * @var string
+ */
+ public $newExperimentProjectId = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'authzToken',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\Model\Security\AuthzToken',
+ ),
+ 2 => array(
+ 'var' => 'existingExperimentID',
+ 'type' => TType::STRING,
+ ),
+ 3 => array(
+ 'var' => 'newExperimentName',
+ 'type' => TType::STRING,
+ ),
+ 4 => array(
+ 'var' => 'newExperimentProjectId',
+ 'type' => TType::STRING,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['authzToken'])) {
+ $this->authzToken = $vals['authzToken'];
+ }
+ if (isset($vals['existingExperimentID'])) {
+ $this->existingExperimentID = $vals['existingExperimentID'];
+ }
+ if (isset($vals['newExperimentName'])) {
+ $this->newExperimentName = $vals['newExperimentName'];
+ }
+ if (isset($vals['newExperimentProjectId'])) {
+ $this->newExperimentProjectId = $vals['newExperimentProjectId'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_cloneExperiment_args';
+ }
+
+ 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::STRUCT) {
+ $this->authzToken = new \Airavata\Model\Security\AuthzToken();
+ $xfer += $this->authzToken->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->existingExperimentID);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->newExperimentName);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->newExperimentProjectId);
+ } 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('Airavata_cloneExperiment_args');
+ if ($this->authzToken !== null) {
+ if (!is_object($this->authzToken)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
+ $xfer += $this->authzToken->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->existingExperimentID !== null) {
+ $xfer += $output->writeFieldBegin('existingExperimentID', TType::STRING, 2);
+ $xfer += $output->writeString($this->existingExperimentID);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->newExperimentName !== null) {
+ $xfer += $output->writeFieldBegin('newExperimentName', TType::STRING, 3);
+ $xfer += $output->writeString($this->newExperimentName);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->newExperimentProjectId !== null) {
+ $xfer += $output->writeFieldBegin('newExperimentProjectId', TType::STRING, 4);
+ $xfer += $output->writeString($this->newExperimentProjectId);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
+class Airavata_cloneExperiment_result {
+ static $_TSPEC;
+
+ /**
+ * @var string
+ */
+ public $success = null;
+ /**
+ * @var \Airavata\API\Error\InvalidRequestException
+ */
+ public $ire = null;
+ /**
+ * @var \Airavata\API\Error\ExperimentNotFoundException
+ */
+ public $enf = null;
+ /**
+ * @var \Airavata\API\Error\AiravataClientException
+ */
+ public $ace = null;
+ /**
+ * @var \Airavata\API\Error\AiravataSystemException
+ */
+ public $ase = null;
+ /**
+ * @var \Airavata\API\Error\AuthorizationException
+ */
+ public $ae = null;
+ /**
+ * @var \Airavata\API\Error\ProjectNotFoundException
+ */
+ public $pnfe = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 0 => array(
+ 'var' => 'success',
+ 'type' => TType::STRING,
+ ),
+ 1 => array(
+ 'var' => 'ire',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\InvalidRequestException',
+ ),
+ 2 => array(
+ 'var' => 'enf',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ExperimentNotFoundException',
+ ),
+ 3 => array(
+ 'var' => 'ace',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataClientException',
+ ),
+ 4 => array(
+ 'var' => 'ase',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AiravataSystemException',
+ ),
+ 5 => array(
+ 'var' => 'ae',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\AuthorizationException',
+ ),
+ 6 => array(
+ 'var' => 'pnfe',
+ 'type' => TType::STRUCT,
+ 'class' => '\Airavata\API\Error\ProjectNotFoundException',
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['success'])) {
+ $this->success = $vals['success'];
+ }
+ if (isset($vals['ire'])) {
+ $this->ire = $vals['ire'];
+ }
+ if (isset($vals['enf'])) {
+ $this->enf = $vals['enf'];
+ }
+ if (isset($vals['ace'])) {
+ $this->ace = $vals['ace'];
+ }
+ if (isset($vals['ase'])) {
+ $this->ase = $vals['ase'];
+ }
+ if (isset($vals['ae'])) {
+ $this->ae = $vals['ae'];
+ }
+ if (isset($vals['pnfe'])) {
+ $this->pnfe = $vals['pnfe'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'Airavata_cloneExperiment_result';
+ }
+
+ 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 0:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->success);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 1:
+ if ($ftype == TType::STRUCT) {
+ $this->ire = new \Airavata\API\Error\InvalidRequestException();
+ $xfer += $this->ire->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::STRUCT) {
+ $this->enf = new \Airavata\API\Error\ExperimentNotFoundException();
+ $xfer += $this->enf->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::STRUCT) {
+ $this->ace = new \Airavata\API\Error\AiravataClientException();
+ $xfer += $this->ace->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::STRUCT) {
+ $this->ase = new \Airavata\API\Error\AiravataSystemException();
+ $xfer += $this->ase->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRUCT) {
+ $this->ae = new \Airavata\API\Error\AuthorizationException();
+ $xfer += $this->ae->read($input);
+ } else {
+ $x
<TRUNCATED>
[11/12] airavata-php-gateway git commit: Merge branch
'AIRAVATA-2316-user-profile-service' into keycloak-integration
Posted by ma...@apache.org.
Merge branch 'AIRAVATA-2316-user-profile-service' into keycloak-integration
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/31b1ca84
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/31b1ca84
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/31b1ca84
Branch: refs/heads/keycloak-integration
Commit: 31b1ca844402ffbeaee3bd6c4e1a77c7684d9c2f
Parents: d021668 05250ee
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Jun 9 17:00:40 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Jun 9 17:00:40 2017 -0400
----------------------------------------------------------------------
app/controllers/AccountController.php | 27 +-
app/controllers/AdminController.php | 12 +-
app/controllers/UserSettingsController.php | 39 ++
app/libraries/AdminUtilities.php | 3 +-
app/libraries/Airavata/API/Airavata.php | 466 ++++++++++++++++++-
app/libraries/UserProfileUtilities.php | 48 ++
app/routes.php | 3 +
app/views/account/settings.blade.php | 16 +
app/views/account/user-profile.blade.php | 94 ++++
app/views/layout/basic.blade.php | 4 +-
app/views/layout/fixed-scripts.blade.php | 8 +-
.../user-profile-phone-template.blade.php | 9 +
public/css/bootstrap.min.css | 2 +-
13 files changed, 686 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/31b1ca84/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --cc app/controllers/AccountController.php
index d8d4a4e,3e70133..99709df
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@@ -123,12 -110,20 +123,13 @@@ class AccountController extends BaseCon
$accessToken = $response->access_token;
$refreshToken = $response->refresh_token;
- $expirationTime = time() + $response->expires_in - 5; //5 seconds safe margin
+ $expirationTime = time() + $response->expires_in - 300; // 5 minutes safe margin
- $userProfile = WSIS::getUserProfileFromOAuthToken($accessToken);
+ $userProfile = Keycloak::getUserProfileFromOAuthToken($accessToken);
$username = $userProfile['username'];
$userRoles = $userProfile['roles'];
+ $userEmail = $userProfile["email"];
- //FIXME There is a bug in WSO2 IS which doest not return the admin role for the default admin user.
- //FIXME Hence as a workaround we manually add it here.
- if ($username == Config::get('pga_config.wsis')['admin-username']
- || $username == Config::get('pga_config.wsis')['admin-username'] . '@' . Config::get('pga_config.wsis')['tenant-domain']){
- $userRoles[] = Config::get('pga_config.wsis')['admin-role-name'];
- }
-
$authzToken = new Airavata\Model\Security\AuthzToken();
$authzToken->accessToken = $accessToken;
$authzToken->claimsMap['gatewayID'] = Config::get('pga_config.airavata')['gateway-id'];
@@@ -189,13 -183,12 +189,13 @@@
$accessToken = $response->access_token;
$refreshToken = $response->refresh_token;
- $expirationTime = time() + $response->expires_in - 5; //5 seconds safe margin
+ $expirationTime = time() + $response->expires_in - 300; //5 minutes safe margin
- $userProfile = WSIS::getUserProfileFromOAuthToken($accessToken);
+ $userProfile = Keycloak::getUserProfileFromOAuthToken($accessToken);
+ Log::debug("userProfile", array($userProfile));
$username = $userProfile['username'];
-
$userRoles = $userProfile['roles'];
+ $userEmail = $userProfile['email'];
//FIXME There is a bug in WSO2 IS which doest not return the admin role for the default admin user.
//FIXME Hence as a workaround we manually add it here.
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/31b1ca84/app/controllers/AdminController.php
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/31b1ca84/app/views/layout/basic.blade.php
----------------------------------------------------------------------
[02/12] airavata-php-gateway git commit: AIRAVATA-2316 Update
Airavata API thrift stubs
Posted by ma...@apache.org.
AIRAVATA-2316 Update Airavata API thrift stubs
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/848d72dc
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/848d72dc
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/848d72dc
Branch: refs/heads/keycloak-integration
Commit: 848d72dcb47658faf1e9e728e147200178b9213c
Parents: 6f55b5b
Author: Marcus Christie <ma...@iu.edu>
Authored: Wed Feb 15 15:03:06 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Wed Feb 15 15:03:06 2017 -0500
----------------------------------------------------------------------
app/libraries/Airavata/API/Airavata.php | 12967 +++++++++++++++----------
1 file changed, 7852 insertions(+), 5115 deletions(-)
----------------------------------------------------------------------
[04/12] airavata-php-gateway git commit: AIRAVATA-2316 Creating basic
user profile when logging in
Posted by ma...@apache.org.
AIRAVATA-2316 Creating basic user profile when logging in
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/1f8d0b82
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/1f8d0b82
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/1f8d0b82
Branch: refs/heads/keycloak-integration
Commit: 1f8d0b8210b8c2ed37dcc918125f8117cb6f00c1
Parents: 3bbfc4d
Author: Marcus Christie <ma...@iu.edu>
Authored: Wed Feb 15 16:13:26 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Wed Feb 15 16:13:26 2017 -0500
----------------------------------------------------------------------
app/controllers/AccountController.php | 23 ++++++++++++++++++++---
app/libraries/UserProfileUtilities.php | 15 +++++++++++++--
2 files changed, 33 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1f8d0b82/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 1490ee1..cc2dd07 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -115,6 +115,7 @@ class AccountController extends BaseController
$userProfile = WSIS::getUserProfileFromOAuthToken($accessToken);
$username = $userProfile['username'];
$userRoles = $userProfile['roles'];
+ $userEmail = $userProfile["email"];
//FIXME There is a bug in WSO2 IS which doest not return the admin role for the default admin user.
//FIXME Hence as a workaround we manually add it here.
@@ -131,6 +132,7 @@ class AccountController extends BaseController
Session::put('authz-token',$authzToken);
Session::put('oauth-refresh-code',$refreshToken);
Session::put('oauth-expiration-time',$expirationTime);
+ // TODO: get rid of user-profile session variable, or at least get rid of having it coming from Identity Server
Session::put("user-profile", $userProfile);
Session::put("roles", $userRoles);
@@ -156,7 +158,7 @@ class AccountController extends BaseController
Session::put("gateway_id", Config::get('pga_config.airavata')['gateway-id']);
if(Session::has("admin") || Session::has("admin-read-only") || Session::has("authorized-user")){
- return $this->initializeWithAiravata($username);
+ return $this->initializeWithAiravata($username, $userEmail);
}
if(Session::has("admin") || Session::has("admin-read-only")){
@@ -189,6 +191,7 @@ class AccountController extends BaseController
$username = $userProfile['username'];
$userRoles = $userProfile['roles'];
+ $userEmail = $userProfile["email"];
//FIXME There is a bug in WSO2 IS which doest not return the admin role for the default admin user.
//FIXME Hence as a workaround we manually add it here.
@@ -203,6 +206,7 @@ class AccountController extends BaseController
Session::put('authz-token',$authzToken);
Session::put('oauth-refresh-code',$refreshToken);
Session::put('oauth-expiration-time',$expirationTime);
+ // TODO: likewise get rid or replace this Identity Server user-profile
Session::put("user-profile", $userProfile);
if (in_array(Config::get('pga_config.wsis')['admin-role-name'], $userRoles)) {
@@ -219,12 +223,12 @@ class AccountController extends BaseController
Session::put("gateway_id", Config::get('pga_config.airavata')['gateway-id']);
if(Session::get("admin") || Session::get("admin-read-only") || Session::get("authorized-user")){
- return $this->initializeWithAiravata($username);
+ return $this->initializeWithAiravata($username, $userEmail);
}
return Redirect::to("home");
}
- private function initializeWithAiravata($username){
+ private function initializeWithAiravata($username, $userEmail){
// Log the user out if Airavata is down. If a new user we want to make
// sure we create the default project and setup experiment storage
@@ -248,6 +252,19 @@ class AccountController extends BaseController
umask($old_umask);
}
+ // Create basic user profile if it doesn't exist
+ if (!UserProfileUtilities::does_user_profile_exist()) {
+ $gatewayId = Session::get("gateway_id");
+ $userProfileData = array();
+ $userProfileData["airavataInternalUserId"] = $username . '@' . $gatewayId;
+ $userProfileData["userId"] = $username;
+ $userProfileData["gatewayId"] = $gatewayId;
+ $userProfileData["emails"] = array($userEmail);
+
+ Log::info("creating user profile for user", array($userProfileData));
+ UserProfileUtilities::add_user_profile($userProfileData);
+ }
+
if(Session::has("admin") || Session::has("admin-read-only")){
return Redirect::to("admin/dashboard");
}else{
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/1f8d0b82/app/libraries/UserProfileUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/UserProfileUtilities.php b/app/libraries/UserProfileUtilities.php
index 929d5c0..5908e59 100644
--- a/app/libraries/UserProfileUtilities.php
+++ b/app/libraries/UserProfileUtilities.php
@@ -1,15 +1,26 @@
<?php
+use Airavata\Model\User\Status;
+use Airavata\Model\User\UserProfile;
class UserProfileUtilities
{
- public static function does_user_profile_exist()
- {
+ public static function does_user_profile_exist() {
$userId = Session::get('username');
$gatewayId = Session::get('gateway_id');
return Airavata::doesUserProfileExist(Session::get('authz-token'), $userId, $gatewayId);
}
+
+ public static function add_user_profile($userProfileData) {
+
+ $userProfile = new UserProfile($userProfileData);
+ $userProfile->creationTime = time();
+ $userProfile->lastAccessTime = time();
+ $userProfile->validUntil = -1;
+ $userProfile->State = Status::ACTIVE;
+ return Airavata::addUserProfile(Session::get('authz-token'), $userProfile);
+ }
}
?>
[10/12] airavata-php-gateway git commit: AIRAVATA-2316 Refactor: move
creation of basic profile
Posted by ma...@apache.org.
AIRAVATA-2316 Refactor: move creation of basic profile
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/05250eef
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/05250eef
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/05250eef
Branch: refs/heads/keycloak-integration
Commit: 05250eefffabc3f534d075a503175f1fba35d020
Parents: 8101966
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Feb 28 10:42:51 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Feb 28 10:42:51 2017 -0500
----------------------------------------------------------------------
app/controllers/AccountController.php | 11 +----------
app/controllers/UserSettingsController.php | 12 +++++++-----
app/libraries/UserProfileUtilities.php | 12 ++++++++++++
3 files changed, 20 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/05250eef/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 8a81f0b..3e70133 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -248,17 +248,8 @@ class AccountController extends BaseController
}
// Create basic user profile if it doesn't exist
- // TODO: Move this to UserProfileUtilities
if (!UserProfileUtilities::does_user_profile_exist($username)) {
- $gatewayId = Session::get("gateway_id");
- $userProfileData = array();
- $userProfileData["airavataInternalUserId"] = $username . '@' . $gatewayId;
- $userProfileData["userId"] = $username;
- $userProfileData["gatewayId"] = $gatewayId;
- $userProfileData["emails"] = array($userEmail);
-
- Log::info("creating user profile for user", array($userProfileData));
- UserProfileUtilities::add_user_profile($userProfileData);
+ UserProfileUtilities::create_basic_user_profile($username, $userEmail);
}
$userProfile = UserProfileUtilities::get_user_profile($username);
Session::put('user-profile', $userProfile);
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/05250eef/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index fa00c35..7b93f19 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -204,11 +204,13 @@ class UserSettingsController extends BaseController
$userProfile->userName = Input::get("userName");
$userProfile->homeOrganization = Input::get("homeOrganization");
$userProfile->country = Input::get("country");
- $phones = Input::get("phones");
- // Filter out empty phone numbers
- $userProfile->phones = array_filter($phones, function($phone) {
- return trim($phone) !== "";
- });
+ if (Input::has("phones")) {
+ $phones = Input::get("phones");
+ // Filter out empty phone numbers
+ $userProfile->phones = array_filter($phones, function($phone) {
+ return trim($phone) !== "";
+ });
+ }
try {
UserProfileUtilities::update_user_profile($userProfile);
// Now update the UserProfile in the Session
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/05250eef/app/libraries/UserProfileUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/UserProfileUtilities.php b/app/libraries/UserProfileUtilities.php
index d4d52f7..720bdd7 100644
--- a/app/libraries/UserProfileUtilities.php
+++ b/app/libraries/UserProfileUtilities.php
@@ -11,6 +11,18 @@ class UserProfileUtilities
return Airavata::doesUserProfileExist(Session::get('authz-token'), $userId, $gatewayId);
}
+ public static function create_basic_user_profile($username, $userEmail) {
+ $gatewayId = Session::get("gateway_id");
+ $userProfileData = array();
+ $userProfileData["airavataInternalUserId"] = $username . '@' . $gatewayId;
+ $userProfileData["userId"] = $username;
+ $userProfileData["gatewayId"] = $gatewayId;
+ $userProfileData["emails"] = array($userEmail);
+
+ Log::info("creating basic user profile for user", array($userProfileData));
+ return UserProfileUtilities::add_user_profile($userProfileData);
+ }
+
public static function add_user_profile($userProfileData) {
$userProfile = new UserProfile($userProfileData);
[03/12] airavata-php-gateway git commit: AIRAVATA-2316 Add user
profile editor view
Posted by ma...@apache.org.
AIRAVATA-2316 Add user profile editor view
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/3bbfc4de
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3bbfc4de
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3bbfc4de
Branch: refs/heads/keycloak-integration
Commit: 3bbfc4dedf7b5ad6f03804b387536859bed7156a
Parents: 848d72d
Author: Marcus Christie <ma...@iu.edu>
Authored: Wed Feb 15 15:03:35 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Wed Feb 15 15:05:16 2017 -0500
----------------------------------------------------------------------
app/controllers/UserSettingsController.php | 8 +++
app/libraries/UserProfileUtilities.php | 15 ++++
app/routes.php | 1 +
app/views/account/settings.blade.php | 16 +++++
app/views/account/user-profile.blade.php | 94 +++++++++++++++++++++++++
public/css/bootstrap.min.css | 2 +-
6 files changed, 135 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bbfc4de/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index a3eba04..49c4257 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -186,4 +186,12 @@ class UserSettingsController extends BaseController
return Redirect::to("account/user-storage-resources")->with("message","Storage Resource Account Settings have been deleted.");
}
}
+
+ public function getUserProfile() {
+
+ $emailAddress = "foo@example.com";
+ return View::make("account/user-profile", array(
+ "emailAddress" => $emailAddress
+ ));
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bbfc4de/app/libraries/UserProfileUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/UserProfileUtilities.php b/app/libraries/UserProfileUtilities.php
new file mode 100644
index 0000000..929d5c0
--- /dev/null
+++ b/app/libraries/UserProfileUtilities.php
@@ -0,0 +1,15 @@
+<?php
+
+
+class UserProfileUtilities
+{
+
+ public static function does_user_profile_exist()
+ {
+ $userId = Session::get('username');
+ $gatewayId = Session::get('gateway_id');
+ return Airavata::doesUserProfileExist(Session::get('authz-token'), $userId, $gatewayId);
+ }
+}
+
+?>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bbfc4de/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index b2e58cd..e750ef1 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -64,6 +64,7 @@ Route::post("account/add-user-srp", "UserSettingsController@addUserStorageResour
Route::post("account/update-user-srp", "UserSettingsController@updateUserStorageResourcePreference");
Route::post("account/delete-user-srp", "UserSettingsController@deleteUserStorageResourcePreference");
+Route::get("account/user-profile", "UserSettingsController@getUserProfile");
/*
* The following routes will not work without logging in.
*
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bbfc4de/app/views/account/settings.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/settings.blade.php b/app/views/account/settings.blade.php
index 62f1177..35bb0ad 100644
--- a/app/views/account/settings.blade.php
+++ b/app/views/account/settings.blade.php
@@ -12,6 +12,22 @@
</ol>
<div class="row well user-settings">
+ <h3>Profile</h3>
+
+ <a href="{{URL::to('/')}}/account/user-profile">
+ <div class=" col-md-12 well">
+ <div class="col-md-12">
+ <span class="glyphicon glyphicon-user user-setting-icon"></span>
+ </div>
+ <div class="col-md-12">
+ <h4>Your Profile</h4>
+ </div>
+ </div>
+ </a>
+ </div>
+
+ <div class="row well user-settings">
+
<h3>Manage Personal Computing and Storage Resources</h3>
<p>Use these settings if you have your own compute and/or
storage resource accounts that you would like to use.</p>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bbfc4de/app/views/account/user-profile.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-profile.blade.php b/app/views/account/user-profile.blade.php
new file mode 100644
index 0000000..53dbef2
--- /dev/null
+++ b/app/views/account/user-profile.blade.php
@@ -0,0 +1,94 @@
+
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+{{ HTML::style('css/user-settings.css')}}
+@stop
+
+@section('content')
+<div class="container">
+ <ol class="breadcrumb">
+ <li><a href="{{ URL::to('/') }}/account/settings">User Settings</a></li>
+ <li class="active">Your Profile</li>
+ </ol>
+
+ <div class="row">
+ <div class="col-md-6 col-md-offset-3">
+ <h1>Profile for {{ Session::get("username") }}</h1>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-6 col-md-offset-3">
+ <form action="{{ URL::to("account/user-profile") }}" method="post" role="form">
+
+ <div class="form-group">
+ <label class="control-label">E-mail</label>
+ <p class="form-control-static">{{{ $emailAddress }}}</p>
+ </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>
+ </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>
+ </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') }}"/>
+ </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') }}"/>
+ </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') }}"/>
+ </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') }}"/>
+ </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') }}"/>
+ </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') }}"/>
+ </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') }}"/>
+ </div>
+ </div>
+ <br/>
+ <input name="update" type="submit" class="btn btn-primary btn-block" value="Update">
+ </form>
+
+</div>
+
+@stop
+
+@section('scripts')
+@parent
+@stop
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bbfc4de/public/css/bootstrap.min.css
----------------------------------------------------------------------
diff --git a/public/css/bootstrap.min.css b/public/css/bootstrap.min.css
index 0f7ca0c..5ee9a45 100644
--- a/public/css/bootstrap.min.css
+++ b/public/css/bootstrap.min.css
@@ -11,7 +11,7 @@ body{
background: #ecf0f1;
}
.form-group.required .control-label:after {
- content:"*";
+ content:" *";
color:red;
}
[07/12] airavata-php-gateway git commit: AIRAVATA-2316 Add ability to
delete phone numbers
Posted by ma...@apache.org.
AIRAVATA-2316 Add ability to delete phone numbers
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/ab980d46
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/ab980d46
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/ab980d46
Branch: refs/heads/keycloak-integration
Commit: ab980d4685a8c89fe0218dbd0f2639489652a4b7
Parents: 310ea4c
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Feb 24 10:04:23 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Feb 24 10:04:23 2017 -0500
----------------------------------------------------------------------
app/views/account/user-profile.blade.php | 13 +++++--------
.../partials/user-profile-phone-template.blade.php | 9 +++++++++
2 files changed, 14 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ab980d46/app/views/account/user-profile.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-profile.blade.php b/app/views/account/user-profile.blade.php
index e9ebeea..86690c4 100644
--- a/app/views/account/user-profile.blade.php
+++ b/app/views/account/user-profile.blade.php
@@ -47,13 +47,10 @@
value="{{{ $userProfile->country }}}"/>
</div>
</div>
- {{-- TODO: need to add delete as well --}}
<div class="form-group">
<label class="control-label">Phone Numbers</label>
@foreach ($userProfile->phones as $phone)
- <input class="form-control" name="phones[]"
- placeholder="Phone number" type="text"
- value="{{{ $phone }}}"/>
+ @include('partials/user-profile-phone-template', array('phone' => $phone))
@endforeach
<button id="add-phone-button" class="btn btn-default" type="button">Add Phone</button>
</div>
@@ -64,8 +61,7 @@
</div>
<div id="new-phone-template" class="hidden">
- <input class="form-control" name="phones[]"
- placeholder="Phone number" type="text" />
+ @include('partials/user-profile-phone-template', array('phone' => ''))
</div>
@stop
@@ -76,8 +72,9 @@
$('#add-phone-button').click(function(e){
$(this).before($('#new-phone-template').html());
- e.preventDefault();
- return false;
+ });
+ $(document).on('click', '.delete-phone-button', function(e){
+ $(this).closest('.input-group').remove();
});
</script>
@stop
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ab980d46/app/views/partials/user-profile-phone-template.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-profile-phone-template.blade.php b/app/views/partials/user-profile-phone-template.blade.php
new file mode 100644
index 0000000..6843f57
--- /dev/null
+++ b/app/views/partials/user-profile-phone-template.blade.php
@@ -0,0 +1,9 @@
+
+<div class="input-group">
+ <input class="form-control" name="phones[]"
+ placeholder="Phone number" type="text"
+ value="{{{ $phone or '' }}}" />
+ <span class="input-group-btn">
+ <button class="btn btn-default delete-phone-button" type="button">Delete</button>
+ </span>
+</div>
[08/12] airavata-php-gateway git commit: AIRAVATA-2316 user profile
editor: success/error messages
Posted by ma...@apache.org.
AIRAVATA-2316 user profile editor: success/error messages
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/5d527c1d
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/5d527c1d
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/5d527c1d
Branch: refs/heads/keycloak-integration
Commit: 5d527c1d580a4498306e77b2780f6e3d0ec08d3f
Parents: ab980d4
Author: Marcus Christie <ma...@iu.edu>
Authored: Fri Feb 24 10:46:48 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Fri Feb 24 10:46:48 2017 -0500
----------------------------------------------------------------------
app/controllers/UserSettingsController.php | 14 ++++++++++----
app/views/account/user-profile.blade.php | 14 ++++++++++++++
2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5d527c1d/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index 099d1e7..abacb02 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -197,7 +197,6 @@ class UserSettingsController extends BaseController
public function updateUserProfile() {
- // TODO: handle errors by redispaying input page
$username = Session::get('username');
$userProfile = UserProfileUtilities::get_user_profile($username);
@@ -210,8 +209,15 @@ class UserSettingsController extends BaseController
$userProfile->phones = array_filter($phones, function($phone) {
return trim($phone) !== "";
});
- Log::debug("userProfile", array($userProfile));
- UserProfileUtilities::update_user_profile($userProfile);
- return Redirect::to("account/user-profile");
+ try {
+ UserProfileUtilities::update_user_profile($userProfile);
+ return Redirect::to("account/user-profile")->with("message", "Your profile has been updated.");
+ } catch (Exception $e) {
+ return View::make("account/user-profile", array(
+ "userProfile" => $userProfile,
+ "errorMessage" => "An error occurred while trying to update your profile: " . $e->getMessage()
+ ));
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/5d527c1d/app/views/account/user-profile.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-profile.blade.php b/app/views/account/user-profile.blade.php
index 86690c4..202284a 100644
--- a/app/views/account/user-profile.blade.php
+++ b/app/views/account/user-profile.blade.php
@@ -13,6 +13,20 @@
<li class="active">Your Profile</li>
</ol>
+ @if( Session::has("message") )
+ <div class="alert alert-success alert-dismissible" role="alert">
+ <button type="button" class="close" data-dismiss="alert"><span
+ aria-hidden="true">×</span><span class="sr-only">Close</span></button>
+ {{{ Session::get("message") }}}
+ </div>
+ @endif
+
+ @if( isset($errorMessage) )
+ <div class="alert alert-danger" role="alert">
+ {{{ $errorMessage }}}
+ </div>
+ @endif
+
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>Profile for {{ Session::get("username") }}</h1>
[12/12] airavata-php-gateway git commit: AIRAVATA-2408 Fixes to user
profile editor
Posted by ma...@apache.org.
AIRAVATA-2408 Fixes to user profile editor
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/3f99eb64
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3f99eb64
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3f99eb64
Branch: refs/heads/keycloak-integration
Commit: 3f99eb644531b0904daf084e74543af6b32d2cfb
Parents: 31b1ca8
Author: Marcus Christie <ma...@iu.edu>
Authored: Sun Jun 11 16:25:02 2017 -0400
Committer: Marcus Christie <ma...@iu.edu>
Committed: Sun Jun 11 16:25:02 2017 -0400
----------------------------------------------------------------------
app/controllers/UserSettingsController.php | 11 +-
app/libraries/Airavata/API/Airavata.php | 466 +------------------
app/views/account/user-profile.blade.php | 43 +-
app/views/layout/basic.blade.php | 2 +-
.../user-profile-phone-template.blade.php | 9 -
5 files changed, 32 insertions(+), 499 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f99eb64/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index 7b93f19..0cd69ec 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -201,16 +201,9 @@ class UserSettingsController extends BaseController
$userProfile = UserProfileUtilities::get_user_profile($username);
// Copy data from form to $userProfile object and update
- $userProfile->userName = Input::get("userName");
+ $userProfile->firstName = Input::get("firstName");
+ $userProfile->lastName = Input::get("lastName");
$userProfile->homeOrganization = Input::get("homeOrganization");
- $userProfile->country = Input::get("country");
- if (Input::has("phones")) {
- $phones = Input::get("phones");
- // Filter out empty phone numbers
- $userProfile->phones = array_filter($phones, function($phone) {
- return trim($phone) !== "";
- });
- }
try {
UserProfileUtilities::update_user_profile($userProfile);
// Now update the UserProfile in the Session
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f99eb64/app/libraries/Airavata/API/Airavata.php
----------------------------------------------------------------------
diff --git a/app/libraries/Airavata/API/Airavata.php b/app/libraries/Airavata/API/Airavata.php
index e1032be..9c20f39 100644
--- a/app/libraries/Airavata/API/Airavata.php
+++ b/app/libraries/Airavata/API/Airavata.php
@@ -4139,6 +4139,12 @@ interface AiravataIf {
* * Externally assertable unique identifier. SAML (primarly in higher education, academic) tends to keep
* * user name less opaque. OpenID Connect maintains them to be opaque.
* *
+ * * firstName, middleName, lastName:
+ * * First and Last names as assertede by the user
+ * *
+ * * namePrefix, nameSuffix:
+ * * prefix and suffix to the users name as asserted by the user
+ * *
* * emails:
* * Email identifier are Verified, REQUIRED and MULTIVALUED
* *
@@ -4200,68 +4206,7 @@ interface AiravataIf {
public function getAllUserProfilesInGateway(\Airavata\Model\Security\AuthzToken $authzToken, $gatewayId, $offset, $limit);
/**
* @param \Airavata\Model\Security\AuthzToken $authzToken
- * @param string $userName
- * @param string $gatewayId
- * @return \Airavata\Model\User\UserProfile * A structure holding the user profile and its child models.
- * *
- * * Notes:
- * * The model does not include passwords as it is assumed an external identity provider is used to authenticate user.
- * * References:
- * * NSF Demographic Information - http://www.nsf.gov/pubs/2000/00form1225/00form1225.doc
- * * LDAP Schema - https://tools.ietf.org/html/rfc4519
- * * SCIM 2.0 - https://tools.ietf.org/html/rfc7643
- * *
- * * userModelVersion:
- * * Version number of profile
- * *
- * * airavataInternalUserId:
- * * internal to Airavata, not intended to be used outside of the Airavata platform or possibly by gateways
- * * (that is, never shown to users), never reassigned, REQUIRED
- * *
- * * userId:
- * * Externally assertable unique identifier. SAML (primarly in higher education, academic) tends to keep
- * * user name less opaque. OpenID Connect maintains them to be opaque.
- * *
- * * emails:
- * * Email identifier are Verified, REQUIRED and MULTIVALUED
- * *
- * * userName:
- * * Name-based identifiers can be multivalues. To keep it simple, Airavata will make it a string.
- * * In the future these can be enumerated as:
- * * Official name (as asserted possibly by some external identity provider)
- * * Prefered name (as asserted or suggested by user directly)
- * * Components:
- * * givenName
- * * surname (familyName)
- * * displayName (often asserted by user to handle things like middle names, suffix, prefix, and the like)
- * *
- * * orcidId: ORCID ID - http://orcid.org/about/what-is-orcid)
- * *
- * * phones: Telephone MULTIVALUED
- * *
- * * country: Country of Residance
- * *
- * * nationality Countries of citizenship
- * *
- * * comments:
- * * Free-form information (treated as opaque by Airavata and simply passed to resource).
- * *
- * * labeledURI:
- * * Google Scholar, Web of Science, ACS, e.t.c
- * *
- * * timeZone:
- * * User’s preferred timezone - IANA Timezone Databases - http://www.iana.org/time-zones.
- * *
- *
- * @throws \Airavata\API\Error\InvalidRequestException
- * @throws \Airavata\API\Error\AiravataClientException
- * @throws \Airavata\API\Error\AiravataSystemException
- * @throws \Airavata\API\Error\AuthorizationException
- */
- public function getUserProfileByName(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId);
- /**
- * @param \Airavata\Model\Security\AuthzToken $authzToken
- * @param string $userName
+ * @param string $userId
* @param string $gatewayId
* @return bool
* @throws \Airavata\API\Error\InvalidRequestException
@@ -4269,7 +4214,7 @@ interface AiravataIf {
* @throws \Airavata\API\Error\AiravataSystemException
* @throws \Airavata\API\Error\AuthorizationException
*/
- public function doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId);
+ public function doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userId, $gatewayId);
}
class AiravataClient implements \Airavata\API\AiravataIf {
@@ -15553,82 +15498,17 @@ class AiravataClient implements \Airavata\API\AiravataIf {
throw new \Exception("getAllUserProfilesInGateway failed: unknown result");
}
- public function getUserProfileByName(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
- {
- $this->send_getUserProfileByName($authzToken, $userName, $gatewayId);
- return $this->recv_getUserProfileByName();
- }
-
- public function send_getUserProfileByName(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
- {
- $args = new \Airavata\API\Airavata_getUserProfileByName_args();
- $args->authzToken = $authzToken;
- $args->userName = $userName;
- $args->gatewayId = $gatewayId;
- $bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
- if ($bin_accel)
- {
- thrift_protocol_write_binary($this->output_, 'getUserProfileByName', TMessageType::CALL, $args, $this->seqid_, $this->output_->isStrictWrite());
- }
- else
- {
- $this->output_->writeMessageBegin('getUserProfileByName', TMessageType::CALL, $this->seqid_);
- $args->write($this->output_);
- $this->output_->writeMessageEnd();
- $this->output_->getTransport()->flush();
- }
- }
-
- public function recv_getUserProfileByName()
- {
- $bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
- if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '\Airavata\API\Airavata_getUserProfileByName_result', $this->input_->isStrictRead());
- else
- {
- $rseqid = 0;
- $fname = null;
- $mtype = 0;
-
- $this->input_->readMessageBegin($fname, $mtype, $rseqid);
- if ($mtype == TMessageType::EXCEPTION) {
- $x = new TApplicationException();
- $x->read($this->input_);
- $this->input_->readMessageEnd();
- throw $x;
- }
- $result = new \Airavata\API\Airavata_getUserProfileByName_result();
- $result->read($this->input_);
- $this->input_->readMessageEnd();
- }
- if ($result->success !== null) {
- return $result->success;
- }
- if ($result->ire !== null) {
- throw $result->ire;
- }
- if ($result->ace !== null) {
- throw $result->ace;
- }
- if ($result->ase !== null) {
- throw $result->ase;
- }
- if ($result->ae !== null) {
- throw $result->ae;
- }
- throw new \Exception("getUserProfileByName failed: unknown result");
- }
-
- public function doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+ public function doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userId, $gatewayId)
{
- $this->send_doesUserProfileExist($authzToken, $userName, $gatewayId);
+ $this->send_doesUserProfileExist($authzToken, $userId, $gatewayId);
return $this->recv_doesUserProfileExist();
}
- public function send_doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userName, $gatewayId)
+ public function send_doesUserProfileExist(\Airavata\Model\Security\AuthzToken $authzToken, $userId, $gatewayId)
{
$args = new \Airavata\API\Airavata_doesUserProfileExist_args();
$args->authzToken = $authzToken;
- $args->userName = $userName;
+ $args->userId = $userId;
$args->gatewayId = $gatewayId;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel)
@@ -69053,312 +68933,6 @@ class Airavata_getAllUserProfilesInGateway_result {
}
-class Airavata_getUserProfileByName_args {
- static $_TSPEC;
-
- /**
- * @var \Airavata\Model\Security\AuthzToken
- */
- public $authzToken = null;
- /**
- * @var string
- */
- public $userName = null;
- /**
- * @var string
- */
- public $gatewayId = null;
-
- public function __construct($vals=null) {
- if (!isset(self::$_TSPEC)) {
- self::$_TSPEC = array(
- 1 => array(
- 'var' => 'authzToken',
- 'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\Security\AuthzToken',
- ),
- 2 => array(
- 'var' => 'userName',
- 'type' => TType::STRING,
- ),
- 3 => array(
- 'var' => 'gatewayId',
- 'type' => TType::STRING,
- ),
- );
- }
- if (is_array($vals)) {
- if (isset($vals['authzToken'])) {
- $this->authzToken = $vals['authzToken'];
- }
- if (isset($vals['userName'])) {
- $this->userName = $vals['userName'];
- }
- if (isset($vals['gatewayId'])) {
- $this->gatewayId = $vals['gatewayId'];
- }
- }
- }
-
- public function getName() {
- return 'Airavata_getUserProfileByName_args';
- }
-
- 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::STRUCT) {
- $this->authzToken = new \Airavata\Model\Security\AuthzToken();
- $xfer += $this->authzToken->read($input);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
- case 2:
- if ($ftype == TType::STRING) {
- $xfer += $input->readString($this->userName);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
- case 3:
- if ($ftype == TType::STRING) {
- $xfer += $input->readString($this->gatewayId);
- } 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('Airavata_getUserProfileByName_args');
- if ($this->authzToken !== null) {
- if (!is_object($this->authzToken)) {
- throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
- }
- $xfer += $output->writeFieldBegin('authzToken', TType::STRUCT, 1);
- $xfer += $this->authzToken->write($output);
- $xfer += $output->writeFieldEnd();
- }
- if ($this->userName !== null) {
- $xfer += $output->writeFieldBegin('userName', TType::STRING, 2);
- $xfer += $output->writeString($this->userName);
- $xfer += $output->writeFieldEnd();
- }
- if ($this->gatewayId !== null) {
- $xfer += $output->writeFieldBegin('gatewayId', TType::STRING, 3);
- $xfer += $output->writeString($this->gatewayId);
- $xfer += $output->writeFieldEnd();
- }
- $xfer += $output->writeFieldStop();
- $xfer += $output->writeStructEnd();
- return $xfer;
- }
-
-}
-
-class Airavata_getUserProfileByName_result {
- static $_TSPEC;
-
- /**
- * @var \Airavata\Model\User\UserProfile
- */
- public $success = null;
- /**
- * @var \Airavata\API\Error\InvalidRequestException
- */
- public $ire = null;
- /**
- * @var \Airavata\API\Error\AiravataClientException
- */
- public $ace = null;
- /**
- * @var \Airavata\API\Error\AiravataSystemException
- */
- public $ase = null;
- /**
- * @var \Airavata\API\Error\AuthorizationException
- */
- public $ae = null;
-
- public function __construct($vals=null) {
- if (!isset(self::$_TSPEC)) {
- self::$_TSPEC = array(
- 0 => array(
- 'var' => 'success',
- 'type' => TType::STRUCT,
- 'class' => '\Airavata\Model\User\UserProfile',
- ),
- 1 => array(
- 'var' => 'ire',
- 'type' => TType::STRUCT,
- 'class' => '\Airavata\API\Error\InvalidRequestException',
- ),
- 2 => array(
- 'var' => 'ace',
- 'type' => TType::STRUCT,
- 'class' => '\Airavata\API\Error\AiravataClientException',
- ),
- 3 => array(
- 'var' => 'ase',
- 'type' => TType::STRUCT,
- 'class' => '\Airavata\API\Error\AiravataSystemException',
- ),
- 4 => array(
- 'var' => 'ae',
- 'type' => TType::STRUCT,
- 'class' => '\Airavata\API\Error\AuthorizationException',
- ),
- );
- }
- if (is_array($vals)) {
- if (isset($vals['success'])) {
- $this->success = $vals['success'];
- }
- if (isset($vals['ire'])) {
- $this->ire = $vals['ire'];
- }
- if (isset($vals['ace'])) {
- $this->ace = $vals['ace'];
- }
- if (isset($vals['ase'])) {
- $this->ase = $vals['ase'];
- }
- if (isset($vals['ae'])) {
- $this->ae = $vals['ae'];
- }
- }
- }
-
- public function getName() {
- return 'Airavata_getUserProfileByName_result';
- }
-
- 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 0:
- if ($ftype == TType::STRUCT) {
- $this->success = new \Airavata\Model\User\UserProfile();
- $xfer += $this->success->read($input);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
- case 1:
- if ($ftype == TType::STRUCT) {
- $this->ire = new \Airavata\API\Error\InvalidRequestException();
- $xfer += $this->ire->read($input);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
- case 2:
- if ($ftype == TType::STRUCT) {
- $this->ace = new \Airavata\API\Error\AiravataClientException();
- $xfer += $this->ace->read($input);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
- case 3:
- if ($ftype == TType::STRUCT) {
- $this->ase = new \Airavata\API\Error\AiravataSystemException();
- $xfer += $this->ase->read($input);
- } else {
- $xfer += $input->skip($ftype);
- }
- break;
- case 4:
- if ($ftype == TType::STRUCT) {
- $this->ae = new \Airavata\API\Error\AuthorizationException();
- $xfer += $this->ae->read($input);
- } 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('Airavata_getUserProfileByName_result');
- if ($this->success !== null) {
- if (!is_object($this->success)) {
- throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
- }
- $xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
- $xfer += $this->success->write($output);
- $xfer += $output->writeFieldEnd();
- }
- if ($this->ire !== null) {
- $xfer += $output->writeFieldBegin('ire', TType::STRUCT, 1);
- $xfer += $this->ire->write($output);
- $xfer += $output->writeFieldEnd();
- }
- if ($this->ace !== null) {
- $xfer += $output->writeFieldBegin('ace', TType::STRUCT, 2);
- $xfer += $this->ace->write($output);
- $xfer += $output->writeFieldEnd();
- }
- if ($this->ase !== null) {
- $xfer += $output->writeFieldBegin('ase', TType::STRUCT, 3);
- $xfer += $this->ase->write($output);
- $xfer += $output->writeFieldEnd();
- }
- if ($this->ae !== null) {
- $xfer += $output->writeFieldBegin('ae', TType::STRUCT, 4);
- $xfer += $this->ae->write($output);
- $xfer += $output->writeFieldEnd();
- }
- $xfer += $output->writeFieldStop();
- $xfer += $output->writeStructEnd();
- return $xfer;
- }
-
-}
-
class Airavata_doesUserProfileExist_args {
static $_TSPEC;
@@ -69369,7 +68943,7 @@ class Airavata_doesUserProfileExist_args {
/**
* @var string
*/
- public $userName = null;
+ public $userId = null;
/**
* @var string
*/
@@ -69384,7 +68958,7 @@ class Airavata_doesUserProfileExist_args {
'class' => '\Airavata\Model\Security\AuthzToken',
),
2 => array(
- 'var' => 'userName',
+ 'var' => 'userId',
'type' => TType::STRING,
),
3 => array(
@@ -69397,8 +68971,8 @@ class Airavata_doesUserProfileExist_args {
if (isset($vals['authzToken'])) {
$this->authzToken = $vals['authzToken'];
}
- if (isset($vals['userName'])) {
- $this->userName = $vals['userName'];
+ if (isset($vals['userId'])) {
+ $this->userId = $vals['userId'];
}
if (isset($vals['gatewayId'])) {
$this->gatewayId = $vals['gatewayId'];
@@ -69435,7 +69009,7 @@ class Airavata_doesUserProfileExist_args {
break;
case 2:
if ($ftype == TType::STRING) {
- $xfer += $input->readString($this->userName);
+ $xfer += $input->readString($this->userId);
} else {
$xfer += $input->skip($ftype);
}
@@ -69468,9 +69042,9 @@ class Airavata_doesUserProfileExist_args {
$xfer += $this->authzToken->write($output);
$xfer += $output->writeFieldEnd();
}
- if ($this->userName !== null) {
- $xfer += $output->writeFieldBegin('userName', TType::STRING, 2);
- $xfer += $output->writeString($this->userName);
+ if ($this->userId !== null) {
+ $xfer += $output->writeFieldBegin('userId', TType::STRING, 2);
+ $xfer += $output->writeString($this->userId);
$xfer += $output->writeFieldEnd();
}
if ($this->gatewayId !== null) {
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f99eb64/app/views/account/user-profile.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-profile.blade.php b/app/views/account/user-profile.blade.php
index 202284a..09bea45 100644
--- a/app/views/account/user-profile.blade.php
+++ b/app/views/account/user-profile.blade.php
@@ -42,10 +42,16 @@
<p class="form-control-static">{{{ $userProfile->emails[0] }}}</p>
</div>
<div class="form-group required">
- <label class="control-label">Name</label>
- <div><input class="form-control" id="userName" maxlength="50" name="userName"
+ <label class="control-label">First Name</label>
+ <div><input class="form-control" id="firstName" maxlength="50" name="firstName"
placeholder="Name" type="text"
- value="{{{ $userProfile->userName }}}"/></div>
+ value="{{{ $userProfile->firstName }}}"/></div>
+ </div>
+ <div class="form-group required">
+ <label class="control-label">Last Name</label>
+ <div><input class="form-control" id="lastName" maxlength="50" name="lastName"
+ placeholder="Name" type="text"
+ value="{{{ $userProfile->lastName }}}"/></div>
</div>
<div class="form-group">
<label class="control-label">Organization</label>
@@ -54,41 +60,10 @@
value="{{{ $userProfile->homeOrganization }}}"/>
</div>
</div>
- <div class="form-group">
- <label class="control-label">Country</label>
- <div><input class="form-control" id="country" name="country"
- placeholder="Country" type="text"
- value="{{{ $userProfile->country }}}"/>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label">Phone Numbers</label>
- @foreach ($userProfile->phones as $phone)
- @include('partials/user-profile-phone-template', array('phone' => $phone))
- @endforeach
- <button id="add-phone-button" class="btn btn-default" type="button">Add Phone</button>
- </div>
<input name="update" type="submit" class="btn btn-primary btn-block" value="Update">
</form>
</div>
-<div id="new-phone-template" class="hidden">
- @include('partials/user-profile-phone-template', array('phone' => ''))
-</div>
-
-@stop
-
-@section('scripts')
-@parent
-<script>
-
- $('#add-phone-button').click(function(e){
- $(this).before($('#new-phone-template').html());
- });
- $(document).on('click', '.delete-phone-button', function(e){
- $(this).closest('.input-group').remove();
- });
-</script>
@stop
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f99eb64/app/views/layout/basic.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/basic.blade.php b/app/views/layout/basic.blade.php
index ad833b4..7561252 100755
--- a/app/views/layout/basic.blade.php
+++ b/app/views/layout/basic.blade.php
@@ -31,7 +31,7 @@ $title = Session::get("portal-title");
@if(Session::has("user-profile"))
<script>
var email = {{ json_encode(Session::get("user-profile")->emails[0]) }};
-var fullName = {{ json_encode(Session::get("user-profile")->userName) }};
+var fullName = {{ json_encode(Session::get("user-profile")->firstName . " " . Session::get("user-profile")->lastName) }};
</script>
@endif
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3f99eb64/app/views/partials/user-profile-phone-template.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/user-profile-phone-template.blade.php b/app/views/partials/user-profile-phone-template.blade.php
deleted file mode 100644
index 6843f57..0000000
--- a/app/views/partials/user-profile-phone-template.blade.php
+++ /dev/null
@@ -1,9 +0,0 @@
-
-<div class="input-group">
- <input class="form-control" name="phones[]"
- placeholder="Phone number" type="text"
- value="{{{ $phone or '' }}}" />
- <span class="input-group-btn">
- <button class="btn btn-default delete-phone-button" type="button">Delete</button>
- </span>
-</div>
[06/12] airavata-php-gateway git commit: AIRAVATA-2316 Adding
multiple phone numbers
Posted by ma...@apache.org.
AIRAVATA-2316 Adding multiple phone numbers
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/310ea4cb
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/310ea4cb
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/310ea4cb
Branch: refs/heads/keycloak-integration
Commit: 310ea4cbb75a6f58158217336a20c6dec3f91eee
Parents: 3bfc4e3
Author: Marcus Christie <ma...@iu.edu>
Authored: Thu Feb 23 13:50:36 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Thu Feb 23 13:50:36 2017 -0500
----------------------------------------------------------------------
app/controllers/UserSettingsController.php | 15 ++++++++++++++-
app/libraries/UserProfileUtilities.php | 10 +---------
app/views/account/user-profile.blade.php | 25 +++++++++++++++++++++++--
3 files changed, 38 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/310ea4cb/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index 054ea05..099d1e7 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -198,7 +198,20 @@ class UserSettingsController extends BaseController
public function updateUserProfile() {
// TODO: handle errors by redispaying input page
- UserProfileUtilities::update_user_profile(Input::all());
+ $username = Session::get('username');
+ $userProfile = UserProfileUtilities::get_user_profile($username);
+
+ // Copy data from form to $userProfile object and update
+ $userProfile->userName = Input::get("userName");
+ $userProfile->homeOrganization = Input::get("homeOrganization");
+ $userProfile->country = Input::get("country");
+ $phones = Input::get("phones");
+ // Filter out empty phone numbers
+ $userProfile->phones = array_filter($phones, function($phone) {
+ return trim($phone) !== "";
+ });
+ Log::debug("userProfile", array($userProfile));
+ UserProfileUtilities::update_user_profile($userProfile);
return Redirect::to("account/user-profile");
}
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/310ea4cb/app/libraries/UserProfileUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/UserProfileUtilities.php b/app/libraries/UserProfileUtilities.php
index 09f4e34..d4d52f7 100644
--- a/app/libraries/UserProfileUtilities.php
+++ b/app/libraries/UserProfileUtilities.php
@@ -27,16 +27,8 @@ class UserProfileUtilities
return Airavata::getUserProfileById(Session::get('authz-token'), $userId, $gatewayId);
}
- public static function update_user_profile($userProfileData) {
+ public static function update_user_profile($userProfile) {
- Log::debug("userProfileData", array($userProfileData));
- $username = Session::get('username');
- $userProfile = UserProfileUtilities::get_user_profile($username);
-
- // Copy data from form to $userProfile object and update
- $userProfile->userName = $userProfileData["userName"];
- $userProfile->homeOrganization = $userProfileData["homeOrganization"];
- $userProfile->country = $userProfileData["country"];
return Airavata::updateUserProfile(Session::get('authz-token'), $userProfile);
}
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/310ea4cb/app/views/account/user-profile.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-profile.blade.php b/app/views/account/user-profile.blade.php
index e96b50c..e9ebeea 100644
--- a/app/views/account/user-profile.blade.php
+++ b/app/views/account/user-profile.blade.php
@@ -47,16 +47,37 @@
value="{{{ $userProfile->country }}}"/>
</div>
</div>
-
- {{-- TODO: add phone numbers --}}
+ {{-- TODO: need to add delete as well --}}
+ <div class="form-group">
+ <label class="control-label">Phone Numbers</label>
+ @foreach ($userProfile->phones as $phone)
+ <input class="form-control" name="phones[]"
+ placeholder="Phone number" type="text"
+ value="{{{ $phone }}}"/>
+ @endforeach
+ <button id="add-phone-button" class="btn btn-default" type="button">Add Phone</button>
+ </div>
<input name="update" type="submit" class="btn btn-primary btn-block" value="Update">
</form>
</div>
+<div id="new-phone-template" class="hidden">
+ <input class="form-control" name="phones[]"
+ placeholder="Phone number" type="text" />
+</div>
+
@stop
@section('scripts')
@parent
+<script>
+
+ $('#add-phone-button').click(function(e){
+ $(this).before($('#new-phone-template').html());
+ e.preventDefault();
+ return false;
+ });
+</script>
@stop
[09/12] airavata-php-gateway git commit: AIRAVATA-2316 Replacing WSO2
IS user-profile code
Posted by ma...@apache.org.
AIRAVATA-2316 Replacing WSO2 IS user-profile code
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/8101966e
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/8101966e
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/8101966e
Branch: refs/heads/keycloak-integration
Commit: 8101966e1084100b5f82a88b92fd0b2d9d9fb1a7
Parents: 5d527c1
Author: Marcus Christie <ma...@iu.edu>
Authored: Tue Feb 28 10:32:27 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Tue Feb 28 10:32:27 2017 -0500
----------------------------------------------------------------------
app/controllers/AccountController.php | 18 +++++++-----------
app/controllers/AdminController.php | 12 +++++++-----
app/controllers/UserSettingsController.php | 3 +++
app/libraries/AdminUtilities.php | 3 +--
app/views/layout/basic.blade.php | 4 ++--
app/views/layout/fixed-scripts.blade.php | 8 ++++----
6 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8101966e/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index aefaffb..8a81f0b 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -132,8 +132,6 @@ class AccountController extends BaseController
Session::put('authz-token',$authzToken);
Session::put('oauth-refresh-code',$refreshToken);
Session::put('oauth-expiration-time',$expirationTime);
- // TODO: get rid of user-profile session variable, or at least get rid of having it coming from Identity Server
- Session::put("user-profile", $userProfile);
Session::put("roles", $userRoles);
if (in_array(Config::get('pga_config.wsis')['admin-role-name'], $userRoles)) {
@@ -189,9 +187,8 @@ class AccountController extends BaseController
$userProfile = WSIS::getUserProfileFromOAuthToken($accessToken);
$username = $userProfile['username'];
-
$userRoles = $userProfile['roles'];
- $userEmail = $userProfile["email"];
+ $userEmail = $userProfile['email'];
//FIXME There is a bug in WSO2 IS which doest not return the admin role for the default admin user.
//FIXME Hence as a workaround we manually add it here.
@@ -206,8 +203,6 @@ class AccountController extends BaseController
Session::put('authz-token',$authzToken);
Session::put('oauth-refresh-code',$refreshToken);
Session::put('oauth-expiration-time',$expirationTime);
- // TODO: likewise get rid or replace this Identity Server user-profile
- Session::put("user-profile", $userProfile);
if (in_array(Config::get('pga_config.wsis')['admin-role-name'], $userRoles)) {
Session::put("admin", true);
@@ -265,6 +260,8 @@ class AccountController extends BaseController
Log::info("creating user profile for user", array($userProfileData));
UserProfileUtilities::add_user_profile($userProfileData);
}
+ $userProfile = UserProfileUtilities::get_user_profile($username);
+ Session::put('user-profile', $userProfile);
if(Session::has("admin") || Session::has("admin-read-only")){
return Redirect::to("admin/dashboard");
@@ -315,14 +312,15 @@ class AccountController extends BaseController
public function dashboard(){
- $userProfile = Session::get("user-profile");
+ $userRoles = Session::get("roles");
+ $userEmail = Session::get("user-profile")->emails[0];
- if( in_array( "gateway-provider", $userProfile["roles"]) ) {
+ if( in_array( "gateway-provider", $userRoles ) ) {
$gatewayOfUser = "";
$gatewaysInfo = CRUtilities::getAllGateways();
foreach ($gatewaysInfo as $index => $gateway) {
- if ($gateway->emailAddress == $userProfile["email"]) {
+ if ($gateway->emailAddress == $userEmail) {
Session::set("gateway_id", $gateway->gatewayId);
$gatewayOfUser = $gateway->gatewayId;
Session::forget("super-admin");
@@ -330,8 +328,6 @@ class AccountController extends BaseController
}
}
if ($gatewayOfUser == "") {
- $userInfo["username"] = $userProfile["username"];
- $userInfo["email"] = $userProfile["email"];
Session::put("new-gateway-provider", true);
}
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8101966e/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index d0aa3e5..617291f 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -11,11 +11,13 @@ class AdminController extends BaseController {
public function dashboard(){
$userInfo = array();
$data = array();
- $userProfile = Session::get("user-profile");
+ $userRoles = Session::get("roles");
+ $username = Session::get("username");
+ $userEmail = Session::get("user-profile")->emails[0];
Session::forget("new-gateway-provider");
//check for gateway provider users
- if( in_array( "gateway-provider", $userProfile["roles"]) ) {
+ if( in_array( "gateway-provider", $userRoles) ) {
$gatewayOfUser = "";
Session::put("super-admin", true);
$gatewaysInfo = CRUtilities::getAllGateways();
@@ -24,7 +26,7 @@ class AdminController extends BaseController {
$gatewayApprovalStatuses = AdminUtilities::get_gateway_approval_statuses();
foreach ($gatewaysInfo as $index => $gateway) {
- if ($gateway->requesterUsername == $userProfile["username"]) {
+ if ($gateway->requesterUsername == $username) {
$gatewayOfUser = $gateway->gatewayId;
Session::forget("super-admin");
Session::put("new-gateway-provider", true);
@@ -47,8 +49,8 @@ class AdminController extends BaseController {
Session::put("requestedGateways", $requestedGateways);
if ($gatewayOfUser == "") {
- $userInfo["username"] = $userProfile["username"];
- $userInfo["email"] = $userProfile["email"];
+ $userInfo["username"] = $username;
+ $userInfo["email"] = $userEmail;
$data["userInfo"] = $userInfo;
$data["gatewaysInfo"] = $gatewaysInfo;
Session::put("new-gateway-provider", true);
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8101966e/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index abacb02..fa00c35 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -211,6 +211,9 @@ class UserSettingsController extends BaseController
});
try {
UserProfileUtilities::update_user_profile($userProfile);
+ // Now update the UserProfile in the Session
+ $userProfile = UserProfileUtilities::get_user_profile($username);
+ Session::put("user-profile", $userProfile);
return Redirect::to("account/user-profile")->with("message", "Your profile has been updated.");
} catch (Exception $e) {
return View::make("account/user-profile", array(
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8101966e/app/libraries/AdminUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/AdminUtilities.php b/app/libraries/AdminUtilities.php
index 03d168b..1352878 100644
--- a/app/libraries/AdminUtilities.php
+++ b/app/libraries/AdminUtilities.php
@@ -47,8 +47,7 @@ class AdminUtilities
$gateway->reviewProposalDescription = $inputs["project-details"];
$gateway->gatewayPublicAbstract = $inputs["public-project-description"];
- $userProfile = Session::get("user-profile");
- $gateway->requesterUsername = $userProfile["username"];
+ $gateway->requesterUsername = Session::get('username');
return Airavata::addGateway(Session::get('authz-token'), $gateway);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8101966e/app/views/layout/basic.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/basic.blade.php b/app/views/layout/basic.blade.php
index b621ecd..d481e9f 100755
--- a/app/views/layout/basic.blade.php
+++ b/app/views/layout/basic.blade.php
@@ -27,8 +27,8 @@ $title = Session::get("portal-title");
<!-- Getting user info -->
@if(Session::has("user-profile"))
<script>
-var email = "{{ Session::get("user-profile")["email"] }}";
-var fullName = "{{Session::get("user-profile")["firstname"] . " " . Session::get("user-profile")["lastname"]}}"
+var email = {{ json_encode(Session::get("user-profile")->emails[0]) }};
+var fullName = {{ json_encode(Session::get("user-profile")->userName) }};
</script>
@endif
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/8101966e/app/views/layout/fixed-scripts.blade.php
----------------------------------------------------------------------
diff --git a/app/views/layout/fixed-scripts.blade.php b/app/views/layout/fixed-scripts.blade.php
index cba435b..2523a5f 100644
--- a/app/views/layout/fixed-scripts.blade.php
+++ b/app/views/layout/fixed-scripts.blade.php
@@ -29,8 +29,8 @@
showCollectorDialog();
});
},fieldValues: {
- email : email !== 'undefined' ? email : "",
- fullname : fullName !== 'undefined' ? fullName : ""
+ email : typeof email !== 'undefined' ? email : "",
+ fullname : typeof fullName !== 'undefined' ? fullName : ""
}
},
"{{ Config::get('pga_config.portal')['jira-help']['request-feature-collector-id'] }}": {
@@ -41,8 +41,8 @@
showCollectorDialog();
});
},fieldValues: {
- email : email !== 'undefined' ? email : "",
- fullname : fullName !== 'undefined' ? fullName : ""
+ email : typeof email !== 'undefined' ? email : "",
+ fullname : typeof fullName !== 'undefined' ? fullName : ""
}
}
});
[05/12] airavata-php-gateway git commit: AIRAVATA-2316 Adding initial
impl of user profile editor
Posted by ma...@apache.org.
AIRAVATA-2316 Adding initial impl of user profile editor
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/3bfc4e33
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/3bfc4e33
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/3bfc4e33
Branch: refs/heads/keycloak-integration
Commit: 3bfc4e33644215f7c2c07d1ceaf9440820b17290
Parents: 1f8d0b8
Author: Marcus Christie <ma...@iu.edu>
Authored: Mon Feb 20 21:12:47 2017 -0500
Committer: Marcus Christie <ma...@iu.edu>
Committed: Mon Feb 20 21:13:29 2017 -0500
----------------------------------------------------------------------
app/controllers/AccountController.php | 3 +-
app/controllers/UserSettingsController.php | 11 ++++-
app/libraries/UserProfileUtilities.php | 22 ++++++++-
app/routes.php | 2 +
app/views/account/user-profile.blade.php | 64 +++++++------------------
5 files changed, 49 insertions(+), 53 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bfc4e33/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index cc2dd07..aefaffb 100644
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -253,7 +253,8 @@ class AccountController extends BaseController
}
// Create basic user profile if it doesn't exist
- if (!UserProfileUtilities::does_user_profile_exist()) {
+ // TODO: Move this to UserProfileUtilities
+ if (!UserProfileUtilities::does_user_profile_exist($username)) {
$gatewayId = Session::get("gateway_id");
$userProfileData = array();
$userProfileData["airavataInternalUserId"] = $username . '@' . $gatewayId;
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bfc4e33/app/controllers/UserSettingsController.php
----------------------------------------------------------------------
diff --git a/app/controllers/UserSettingsController.php b/app/controllers/UserSettingsController.php
index 49c4257..054ea05 100644
--- a/app/controllers/UserSettingsController.php
+++ b/app/controllers/UserSettingsController.php
@@ -189,9 +189,16 @@ class UserSettingsController extends BaseController
public function getUserProfile() {
- $emailAddress = "foo@example.com";
+ $userProfile = UserProfileUtilities::get_user_profile(Session::get("username"));
return View::make("account/user-profile", array(
- "emailAddress" => $emailAddress
+ "userProfile" => $userProfile
));
}
+
+ public function updateUserProfile() {
+
+ // TODO: handle errors by redispaying input page
+ UserProfileUtilities::update_user_profile(Input::all());
+ return Redirect::to("account/user-profile");
+ }
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bfc4e33/app/libraries/UserProfileUtilities.php
----------------------------------------------------------------------
diff --git a/app/libraries/UserProfileUtilities.php b/app/libraries/UserProfileUtilities.php
index 5908e59..09f4e34 100644
--- a/app/libraries/UserProfileUtilities.php
+++ b/app/libraries/UserProfileUtilities.php
@@ -6,8 +6,7 @@ use Airavata\Model\User\UserProfile;
class UserProfileUtilities
{
- public static function does_user_profile_exist() {
- $userId = Session::get('username');
+ public static function does_user_profile_exist($userId) {
$gatewayId = Session::get('gateway_id');
return Airavata::doesUserProfileExist(Session::get('authz-token'), $userId, $gatewayId);
}
@@ -21,6 +20,25 @@ class UserProfileUtilities
$userProfile->State = Status::ACTIVE;
return Airavata::addUserProfile(Session::get('authz-token'), $userProfile);
}
+
+ public static function get_user_profile($userId) {
+
+ $gatewayId = Session::get('gateway_id');
+ return Airavata::getUserProfileById(Session::get('authz-token'), $userId, $gatewayId);
+ }
+
+ public static function update_user_profile($userProfileData) {
+
+ Log::debug("userProfileData", array($userProfileData));
+ $username = Session::get('username');
+ $userProfile = UserProfileUtilities::get_user_profile($username);
+
+ // Copy data from form to $userProfile object and update
+ $userProfile->userName = $userProfileData["userName"];
+ $userProfile->homeOrganization = $userProfileData["homeOrganization"];
+ $userProfile->country = $userProfileData["country"];
+ return Airavata::updateUserProfile(Session::get('authz-token'), $userProfile);
+ }
}
?>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bfc4e33/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index e750ef1..1486751 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -65,6 +65,8 @@ Route::post("account/update-user-srp", "UserSettingsController@updateUserStorage
Route::post("account/delete-user-srp", "UserSettingsController@deleteUserStorageResourcePreference");
Route::get("account/user-profile", "UserSettingsController@getUserProfile");
+Route::post("account/user-profile", "UserSettingsController@updateUserProfile");
+
/*
* The following routes will not work without logging in.
*
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/3bfc4e33/app/views/account/user-profile.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/user-profile.blade.php b/app/views/account/user-profile.blade.php
index 53dbef2..e96b50c 100644
--- a/app/views/account/user-profile.blade.php
+++ b/app/views/account/user-profile.blade.php
@@ -12,79 +12,47 @@
<li><a href="{{ URL::to('/') }}/account/settings">User Settings</a></li>
<li class="active">Your Profile</li>
</ol>
-
+
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h1>Profile for {{ Session::get("username") }}</h1>
</div>
</div>
-
+
<div class="row">
<div class="col-md-6 col-md-offset-3">
<form action="{{ URL::to("account/user-profile") }}" method="post" role="form">
<div class="form-group">
<label class="control-label">E-mail</label>
- <p class="form-control-static">{{{ $emailAddress }}}</p>
- </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>
+ <p class="form-control-static">{{{ $userProfile->emails[0] }}}</p>
</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>
+ <label class="control-label">Name</label>
+ <div><input class="form-control" id="userName" maxlength="50" name="userName"
+ placeholder="Name" type="text"
+ value="{{{ $userProfile->userName }}}"/></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') }}"/>
- </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') }}"/>
+ <div><input class="form-control" id="homeOrganization" name="homeOrganization"
+ placeholder="Organization" type="text"
+ value="{{{ $userProfile->homeOrganization }}}"/>
</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') }}"/>
- </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') }}"/>
- </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') }}"/>
- </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="Country" type="text"
+ value="{{{ $userProfile->country }}}"/>
</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') }}"/>
- </div>
- </div>
- <br/>
+
+ {{-- TODO: add phone numbers --}}
+
<input name="update" type="submit" class="btn btn-primary btn-block" value="Update">
</form>
-
+
</div>
@stop