You are here

function GLExchange::uploadTranslatable in GlobalLink Connect for Drupal 7.7

* Uploads the document to project director for translation * *

Parameters

* $document: * PDDocument that requires translation * @return Document ticket

File

gl_ws/glc/GLExchange.php, line 922

Class

GLExchange

Code

function uploadTranslatable($document) {
  if (!isset($this->submission) || !isset($this->submission->ticket)) {
    throw new Exception("Submission not initialized.");
  }
  $this
    ->_validateDocument($document);
  $documentInfo = $document
    ->getDocumentInfo($this->submission);
  $resourceInfo = $document
    ->getResourceInfo();
  $submitDocumentWithBinaryResourceRequest = new submitDocumentWithBinaryResource();
  $submitDocumentWithBinaryResourceRequest->documentInfo = $documentInfo;
  $submitDocumentWithBinaryResourceRequest->resourceInfo = $resourceInfo;
  $submitDocumentWithBinaryResourceRequest->data = $document->data;
  $documentTicket = $this->documentService
    ->submitDocumentWithBinaryResource($submitDocumentWithBinaryResourceRequest)->return;
  if (isset($documentTicket)) {
    $this->submission->ticket = $documentTicket->submissionTicket;
  }
  return $documentTicket->ticketId;
}