Import Projects without Internet Connection

Background

TQLEngine UI supports importing of projects whose contents (as .zip) are provided as HTTP downloadable file. In some cases the controllers on which TQLEngine is installed my not have proper / stable internet connection. Therefore importing of projects may be come problematic. Here are the steps on how to import projects where there is no internet connection.

  1. Download and install TQLEngine using normal procedure outlined here.
  2. Cd to TQLEngine installation folder
  3. Create directories:
    1. mkdir -p resources/fileserver/deploy
    2. mkdir localrepo
  4. Create a file named "GenericStaticFile.mqp.xml" in resources/fileserver/deploy folder with content:

    Serve Files Locally
    <NewPackage>
      <RESTHeaders>
        <Headers>
          <Connection>close</Connection>
          <Access-Control-Allow-Origin>*</Access-Control-Allow-Origin>
          <Access-Control-Allow-Methods>GET, POST, PUT
          </Access-Control-Allow-Methods>
          <Access-Control-Allow-Headers>Content-Type,
            X-Atomiton-Studio-Key,X-Atomiton-Session-Key
          </Access-Control-Allow-Headers>
        </Headers>
      </RESTHeaders>
    
      <NewFacetInstance fid='localfiles' name='File' Type='SffHttpStaticFileFacet'>
        <OnActivate>
          <Process BasePath='.' Resource='localrepo' TailPath='index.html'>
            <Include>RESTHeaders</Include>
          </Process>
        </OnActivate>
      </NewFacetInstance>
    </NewPackage>
  5. Add this entry to sff.local.config.xml file

    Sff Local Config file
    <sff.local.deploy>resources/fileserver/deploy</sff.local.deploy>
  6. Restart the engine.
  7. You can serve any file in localrepo folder using the endpoint

    Files EndPoint
    http://<HostORIPofTQLEngine>:<PortOfTQLEngine>/fid-localfiles/localrepo/<NameOfFileYouWantTOView>
  8. If you export the project from TQLStudio or get project zip files from elsewhere you can always copy the zip files to localrepo folder on the controller machine using (scp or other commands)
  9. Now you can import the project using endpoint in step 7.