• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

NAB: using vvout_file to deliver PDF files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NAB: using vvout_file to deliver PDF files

    I'm working on a proof of concept app to deliver pdf documents to our end users.

    I've got the basics working under NAB:
    configured the appropriate items to display a grid of the available documents,
    clicking on one of the grid entry calls a back end program that uses vvout_File to send the pdf to the browser
    browser opens the document in a separate tab, tab is labeled with the file name specified in vvout.file,

    Things I'd like to address:
    Would like to control the "internal" document name. Within the browser tab, the document has a user unfriendly label (I.e., 431df424-f0d7-449f-84f6-0c8a554b7f80) that is used as the default name for the download
    Would like to change the open behavior. Rather than opening a separate tab, I'd like to mimic the behavior in the Nitro Source Editor (document opens in a frame within the app).

    Are these things I can configure within NAB, or will I have to build the application with Sencha Architect to get the desired changes?

  • #2
    You can use the utility widget "URL Widget" which is an iframe so you can load the PDF into that widget. From behaviors you can dynamically change the value of the URL to display different documents based on what the user is clicking.

    Some links to the guides:
    Utility Widgets
    URL Widget

    Comment


    • #3
      Johnny:

      Thanks for the suggestion. Not quite sure what the URL should be in order to load the pdf into the widget.

      The grid row contains the full IFS path to the pdf document (ie., /home/JCALLAHAN/ACC_GLReport_2010H2.pdf)

      If I append that value to the Valence server instance running the app ( http://myserver:7052 ) to build the URL string, I get a "server refused to connect" error message in response.







      Comment


      • #4
        You will need to open up the path "folder" on the IFS in the Apache server config so you can serve the document.

        You will see an example of that config with a comment of "# Valence resources" in your Apache config.

        Thanks

        Comment


        • #5
          Assuming all the pdf documents were contained in an IFS directory /usr/local/Report

          I would modify the /www/valence52/conf/httpd.conf

          by adding a new "set" of configuration directives for this directory

          # Report resources
          Alias /Report /usr/local/Report
          <Directory /usr/local/Report>
          Order Allow,Deny
          allow from all
          </Directory>

          and the URL created for the URL widget would point to the relative path from within /usr/local/Report rather than its "absolute" path within the IFS

          For a file /usr/local/Report/mydir/myfile.pdf

          The correct link would be

          http://myserver:7052/Report/mydir/myfile.pdf
          Last edited by jcallahan; 12-31-2019, 12:17 PM.

          Comment


          • #6
            Looks good to me.

            Comment


            • #7
              Something not quite right.

              I'm in a year end lock down, so I can't change the production configuration.
              [I'm aware that I need to move to a multiple instance setup, per the December 2019 blog]

              What I copied one of my sample pdf documents into the same directory as the shipped CNX pdf example to avoid changing the config, and modified my object path to point to the new location.

              Now getting an error
              :
              "[Tue Dec 31 13:34:59.376952 2019] [autoindex:error] [pid 324:tid 0000003C] [client 10.1.4.149:64566] ZSRV_MSG0356: mod_autoindex: Cannot serve directory /valence-5.2/desktop/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive, referer: http://s78058ax.ific.local:7052/build/production/Runner/index.html?app=1016&lang=en&sid=73IWIEPPPMC5B0LLF2 GS30FHX23OPIIPTFR3D6CFO2V6H4ENF9DA8M12GICHYF28&env =1&key=15778173401477813&theme=default"

              Comment


              • #8
                I am not sure what might be going on based off your post but feel free to email support@cnxcorp.com and we could get on an online meeting. Thanks

                Comment


                • #9
                  In case someone is looking at this post it was fixed by placing the correct data source field in the URL for the URL Widget. The data source field contained the file path.

                  Comment

                  Working...
                  X