We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45206
    • 32 Posts
    Hello,

    After being able to extract all resources without supplementing, thanks to theboxer (https://forums.modx.com/thread/95316/teleport-custom-tpl-for-extracting#dis-post-516052), I'm trying now to extract all elements without supplementing. That means extracting databases and selective files. I think, I have quite understood how to extract selective part of the database, but I have no idea how to extract only parts of the assets directory.

    Could you help me writing this custom template and above all is there somewhere a comprehensive documentation of Teleport ?

    Thanks in advance.
    JeanClaude
      • 29661
      • 116 Posts
      Hello again smiley

      In this part, where you are using xPDOFileVehicle

      {
          "vehicle_class": "xPDOFileVehicle",
          "object": {
              "source": "{+properties.modx.context_web_path}assets",
              "target": "return MODX_BASE_PATH;"
          },
          "attributes": {
              "vehicle_class": "xPDOFileVehicle"
          }
      }
      


      you can use FileVehicle, which will look like:

      {
              "vehicle_class": "\\Teleport\\Transport\\FileVehicle",
              "vehicle_parent_class": "xPDOFileVehicle",
              "object": {
                  "in": "{+properties.modx.core_path}components",
                  "target": "return MODX_CORE_PATH;"
              },
              "attributes": {
                  "vehicle_package": "",
                  "vehicle_class": "\\Teleport\\Transport\\FileVehicle",
                  "vehicle_parent_class": "xPDOFileVehicle"
              }
          }
      


      This will use Symfony2 finder component, so you can pass aditional params, for example "notPath", like this:

      {
              "vehicle_class": "\\Teleport\\Transport\\FileVehicle",
              "vehicle_parent_class": "xPDOFileVehicle",
              "object": {
                  "in": "{+properties.modx.core_path}components",
                 "notPath": "somedirectory",
                  "target": "return MODX_CORE_PATH;"
              },
              "attributes": {
                  "vehicle_package": "",
                  "vehicle_class": "\\Teleport\\Transport\\FileVehicle",
                  "vehicle_parent_class": "xPDOFileVehicle"
              }
          }
      


      Which will call

      $finder->notPath('somedirectory');
        --
        John
        @theboxer