<dtml-var manage_page_header>

<dtml-var "manage_tabs(this(), _, )">

<main class="container-fluid">

  <p class="form-help">
    You can export Zope objects to a file in order to transfer
    them to a different Zope installation. You can either choose
    to download the export file to your local machine, or save it
    in the <code>var</code> directory of your Zope installation
    on the server.
    <strong>Note:</strong>
    Zope can export/import objects in a binary format (called
    ZEXP). The ZEXP format is the officially supported export/import
    format for moving data between <em>identical</em> Zope installations.
    It is <em>not</em> a migration tool.
  </p>

  <form action="manage_exportObject" method="post" class="zmi-export">

    <div class="form-group row">
      <label for="id" class="col-sm-3 col-md-2">Export object id</label>
      <div class="col-sm-9 col-md-10">
        <input class="form-control" type="text" name="id"
               value="<dtml-if ids><dtml-var "ids[0]" html_quote></dtml-if>"/>
      </div>
    </div>

    <div class="form-group row">
      <label for="download" class="col-sm-3 col-md-2">Export to</label>
      <div class="col-sm-9 col-md-10" id="download">
        <div class="form-check">
          <input class="form-check-input" type="radio" name="download:int"
                 value="1" id="download_local" />
          <label for="download_local" class="form-check-label">
            Download to local machine
          </label>
        </div>
        <div class="form-check">
          <input class="form-check-input" type="radio" name="download:int"
                 value="0" id="download_server" checked />
          <label for="download_server" class="form-check-label">
            Save to file on server
          </label>
        </div>
      </div>
    </div>

    <div class="zmi-controls">
      <input class="btn btn-primary" type="submit" name="submit" value="Export" />
    </div>

  </form>

  <hr />

  <p class="form-help">
    You may import Zope objects which have been previously
    exported to a file, by placing the file in the &quot;import&quot;
    directory of your Zope installation on the server. You should create
    the &quot;import&quot; directory in the root of your Zope installation
    if it does not yet exist.
    <br />
    Note that by default, you will become the owner of the objects
    that you are importing. If you wish the imported objects to retain
    their existing ownership information, select "retain existing
    ownership information".
    <br />
    Suppressing events during an import will prevent e.g. the addition of
    records for imported objects to a Catalog. Only select this if you are
    aware of the consequences.
  </p>

  <form action="manage_importObject" method="post" class="zmi-import">


    <div class="form-group row">
      <label for="file" class="col-sm-3 col-md-2">Import file name</label>
      <div class="col-sm-9 col-md-10">
        <select class="form-control" id="file" name="file">
          <dtml-in "list_imports()">
            <option value="<dtml-var sequence-item>">
              <dtml-var sequence-item>
            </option>
          </dtml-in>
        </select>
      </div>
    </div>

    <div class="form-group row">
      <label for="ownership" class="col-sm-3 col-md-2">Ownership</label>
      <div class="col-sm-9 col-md-10" id="Ownership">
        <div class="form-check">
          <input type="radio" class="form-check-input" name="set_owner:int"
                 value="1" id="owner_take" checked />
          <label for="owner_take" class="form-check-label">
            Take ownership of imported objects
          </label>
        </div>
        <div class="form-check">
          <input type="radio" class="form-check-input" name="set_owner:int"
                 value="0" id="owner_retain" />
          <label for="owner_retain" class="form-check-label">
            Retain existing ownership information
          </label>
        </div>
      </div>
    </div>

    <div class="form-group row">
      <label for="suppress_events" class="col-sm-3 col-md-2">
        Suppress events
      </label>
      <div class="col-sm-9 col-md-10" id="Ownership">
        <div class="form-check">
          <input type="checkbox" class="form-check-input"
                 name="suppress_events:int"
                 value="1" id="suppress_events" />
          <label for="suppress_events" class="form-check-label">
            Suppress events during import. Dangerous, see comment above.
          </label>
        </div>
      </div>
    </div>

    <div class="zmi-controls">
      <input class="btn btn-primary" type="submit" name="submit" value="Import" />
    </div>

  </form>

</main>

<dtml-var manage_page_footer>
