Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1893

Allow Tuque to export directly to files

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 7.x-1.9
    • Component/s: Tuque API
    • Labels:
      None

      Description

      Allow Tuque to write object exports from Fedora directly to files. Presently, Tuque fetches exports into memory, which can result in extremely high memory usage should objects contain large datastreams.

      This may be partially related to ISLANDORA-1193.

      h3. Use Case

      Allow Tuque to write directly to files so we can interact with objects with large datastreams.

      h3. Technical Approach

      Add an additional parameter to the [{{FedoraApiM::export()}}|https://github.com/Islandora/tuque/blob/e2d22fc124f929ed57490288035a1f96e294fd4b/FedoraApi.php#L763-L798] and [{{FedoraApiM::getObjectXML()}}|https://github.com/Islandora/tuque/blob/e2d22fc124f929ed57490288035a1f96e294fd4b/FedoraApi.php#L962-L982] methods, handled in much the same manner as [{{FedoraApiA::getDatastreamDissemination()}}|https://github.com/Islandora/tuque/blob/e2d22fc124f929ed57490288035a1f96e294fd4b/FedoraApi.php#L315-L347]'s [{{$file}} parameter|https://github.com/Islandora/tuque/blob/e2d22fc124f929ed57490288035a1f96e294fd4b/FedoraApi.php#L326-L327].

      h3. Test Case

      There are no invocations of {{FedoraApiM::export()}} or {{FedoraApiM::getObjectXML()}} in the core of Islandora... As such, could just roll something like:

      {code}
      $tuque = islandora_get_tuque_connection();
      $temp_file = drupal_tempnam('temporary://', 'temp');
      $tuque->api->m->export('islandora:root', array(), $temp_file);
      print(file_get_contents($temp_file) === $tuque->api->m->export('islandora:root') ? 'equal' : 'different');
      {code}

      ... Which is to say, the content of the file is the exact same as the string which was previously returned from the {{FedoraApiM::export()}} call (and similarly for {{FedoraApiM::getObjectXML()}}).

      h3. Impact

      None/minimal; this is an additive change which should allow exports to be used more reliably when called with the new parameter.

      ----

      Adam Vessey
      Developer
      discoverygarden inc. | Managing Digital Content

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                adam.vessey Adam Vessey
                Reporter:
                adam.vessey Adam Vessey
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: