Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Is it possible to disable the magnifying glass of "viewFile"?

    I'm new to smart client and developing a web application with SmartClient not SmartGWT.
    When I use a datasource with image file saved in the database as wav files, I see 2 icons: the magnifying glass associated to "viewFile" and the red arrow down associated to "downloadFile" on the editing image file column (see attachment 01-ViewFile&DownloadFile.png). The "viewFile" depends on the presence of the associated image file web browser plug-in. That's why I'm interested in hiding this icon but not the other one.
    Is there a way to hide the magnifying glass icon on a imageFile type of datasource?
    Note: The "viewFile" works fine with my firefox browser via QuickTime plug-in but doesn't work with the Internet Explorer 7.
    Attached Files
    Last edited by joaoalmeida; 12 Jul 2010, 07:27.

    #2
    There's not currently a way to suppress the icon. Not sure what you mean about a browser plugin - if you point IE directly to a media file it supports, it just renders that image. The View icon is the equivalent of doing this.

    Is this a customized browser of some kind where that functionality has been broken?

    Comment


      #3
      I'm using the Microsoft IE 7 (see attached file 01-IE-Version.png).
      I've installed and enabled the QuickTime plugin (see attached file 02-IE-QuickTime-PluginEnabled.png).
      Apparently IE is not able to view the file (see attached file 03-IE-QuickTime-PluginLaunchedFailed.png), however, Firefox is able to do it.
      Have you tried to view a wav file with this smartclient component? Apparently the view file doesn't work for wav files with Microsoft IE. What can I do to fix this issue?
      Attached Files

      Comment


        #4
        This basically just looks like a bug in the QuickTime plugin - although it's likely the default for the QuickTime plugin, you shouldn't associate it with .wav files as it apparently can't handle this situation (Windows Media player, the default handler, does handle this).

        Comment


          #5
          Don’t get me wrong but I’m having a hard time to believe that the bug is with QuickTime. I am using the latest version 7.6.6 (00-QuickTime-Version.png). I use QuickTime on several web sites and I’m able to play audio files with no problems. The only problem I found is when the audio file is rendered by SmartClient.
          I am actually able to build a workaround using QuickTime as a gateway (as man-in-the –middle) to play the audio file (01-QuickTime-BrowserTab-MIMETypes-DisableWavFiles.png). Then I forced QuickTime to launch whenever there is a wav file (02-QuickTime-BrowserTab-FileTypes-EnableWavFiles.png); however I configured Windows Media Player as a default application to play a wav file (03-RightClickWavFile-OpenWithSelectWidowsMediaPlayer-Default.png).
          The result is that it works when I click on the “viewFile” magnifying glass icon (04-IE-ViewFileResult-DefaultWindowsMediaPlayer.png) and when I click on “downloadFile” icon as well.
          However the web client must use QuickTime as a gateway to play the wav file. I don’t want to relay on tricks and workarounds. That’s why I ask for your help. Is there another way to deal with that? Have you tried to open a wav file with the "viewFile" method? Any help is appreciated.
          Attached Files

          Comment


            #6
            We're not "rendering" the .wav file. The view icon is a simple HTML link - take a look, you can just copy and paste the URL to a new tab and demonstrate for yourself that the problem is a Quicktime / browser issue.

            Comment


              #7
              SmartClient Version: v8.2p_2012-05-24/PowerEdition Deployment
              Firefox 11 and 12, Chrome 19.0.1084.52 m

              I'm looking for a way to disable the view icon because I'm having a problem with Chrome and Firefox browsers, trying to viewing a PDF file stored in a blob.
              With Chrome, the opened window hangs with the 'loading' message.
              With Firefox, it display the content as text. Also, when downloading with FF, it doesn't recognize it as a PDF, but as a text file.

              it seems it doesn't apply the contentType "application/x-www-form-urlencoded"

              With IE8, it works.
              This is the server side log:
              Code:
              === 2012-05-25 11:20:56,328 [c-40] INFO  RequestContext - URL: '/Eleven/isomorphic/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5': Safari with Accept-Encoding header
              === 2012-05-25 11:20:56,328 [c-40] DEBUG XML - Parsed XML from (in memory stream): 0ms
              === 2012-05-25 11:20:56,781 [c-40] DEBUG RPCManager - Processing 1 requests.
              === 2012-05-25 11:20:56,906 [c-40] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                  criteria:{
                      ID_REC:204790,
                      download_fieldname:"PDF",
                      download_filename:"Tempocasa_05-07-2012.pdf"
                  },
                  operationConfig:{
                      dataSource:"PASSAGGI_STATO_RICHIESTE",
                      operationType:"viewFile"
                  },
                  appID:"builtinApplication",
                  operation:"PASSAGGI_STATO_RICHIESTE_viewFile",
                  oldValues:{
                      ID_REC:204790,
                      download_fieldname:"PDF",
                      download_filename:"Tempocasa_05-07-2012.pdf"
                  }
              }
              === 2012-05-25 11:20:56,984 [c-40] INFO  IDACall - Performing 1 operation(s)
              === 2012-05-25 11:20:56,984 [c-40] DEBUG AppBase - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile] No userTypes defined, allowing anyone access to all operations for this application
              === 2012-05-25 11:20:56,984 [c-40] DEBUG AppBase - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile] No public zero-argument method named '_PASSAGGI_STATO_RICHIESTE_viewFile' found, performing generic datasource operation
              === 2012-05-25 11:20:57,141 [c-40] DEBUG AppBase - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
              === 2012-05-25 11:20:57,141 [c-40] DEBUG AppBase - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
              === 2012-05-25 11:20:57,141 [c-40] INFO  SQLDataSource - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] Performing fetch operation with
              	criteria: {ID_REC:204790,download_fieldname:"PDF",download_filename:"Tempocasa_05-07-2012.pdf"}	values: {ID_REC:204790,download_fieldname:"PDF",download_filename:"Tempocasa_05-07-2012.pdf"}
              === 2012-05-25 11:20:57,234 [c-40] INFO  SQLDataSource - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause AND $defaultJoinWhereClause ORDER BY DATA_PASSAGGIO_STATO desc
              === 2012-05-25 11:20:57,234 [c-40] INFO  SQLDataSource - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] Executing SQL query on 'dbEleven': SELECT PASSAGGI_STATO_RICHIESTE.DATA_PASSAGGIO_STATO, PASSAGGI_STATO_RICHIESTE.ID_REC, PASSAGGI_STATO_RICHIESTE.ID_RICHIESTA_FK, PASSAGGI_STATO_RICHIESTE.NOTE, PASSAGGI_STATO_RICHIESTE.OPERATORE, PASSAGGI_STATO_RICHIESTE.PDF, PASSAGGI_STATO_RICHIESTE.PDF_date_created, PASSAGGI_STATO_RICHIESTE.PDF_filename, PASSAGGI_STATO_RICHIESTE.PDF_filesize, PASSAGGI_STATO_RICHIESTE.STATO_RICHIESTA_FK, PASSAGGI_STATO_RICHIESTE.UNIQUE_ID, STATI_RICHIESTA.STATO_RICHIESTA, STATI_RICHIESTA.DESCR_STATO_RICHIESTA FROM DBELEVEN.PASSAGGI_STATO_RICHIESTE, DBELEVEN.STATI_RICHIESTA WHERE (PASSAGGI_STATO_RICHIESTE.ID_REC='204790') AND STATI_RICHIESTA.ID_REC = PASSAGGI_STATO_RICHIESTE.STATO_RICHIESTA_FK ORDER BY DATA_PASSAGGIO_STATO desc
              === 2012-05-25 11:20:57,984 [c-40] DEBUG PoolableSQLConnectionFactory - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] Returning pooled Connection
              === 2012-05-25 11:20:57,984 [c-40] DEBUG SQLTransaction - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] Started new dbEleven transaction "68465766"
              === 2012-05-25 11:20:57,984 [c-40] INFO  SQLDriver - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] Executing SQL query on 'dbEleven': SELECT PASSAGGI_STATO_RICHIESTE.DATA_PASSAGGIO_STATO, PASSAGGI_STATO_RICHIESTE.ID_REC, PASSAGGI_STATO_RICHIESTE.ID_RICHIESTA_FK, PASSAGGI_STATO_RICHIESTE.NOTE, PASSAGGI_STATO_RICHIESTE.OPERATORE, PASSAGGI_STATO_RICHIESTE.PDF, PASSAGGI_STATO_RICHIESTE.PDF_date_created, PASSAGGI_STATO_RICHIESTE.PDF_filename, PASSAGGI_STATO_RICHIESTE.PDF_filesize, PASSAGGI_STATO_RICHIESTE.STATO_RICHIESTA_FK, PASSAGGI_STATO_RICHIESTE.UNIQUE_ID, STATI_RICHIESTA.STATO_RICHIESTA, STATI_RICHIESTA.DESCR_STATO_RICHIESTA FROM DBELEVEN.PASSAGGI_STATO_RICHIESTE, DBELEVEN.STATI_RICHIESTA WHERE (PASSAGGI_STATO_RICHIESTE.ID_REC='204790') AND STATI_RICHIESTA.ID_REC = PASSAGGI_STATO_RICHIESTE.STATO_RICHIESTA_FK ORDER BY DATA_PASSAGGIO_STATO desc
              === 2012-05-25 11:20:58,016 [c-40] INFO  DSResponse - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile, builtinApplication.null] DSResponse: List with 1 items
              === 2012-05-25 11:20:58,016 [c-40] INFO  DSResponse - [builtinApplication.PASSAGGI_STATO_RICHIESTE_viewFile] DSResponse: Map with 12 keys
              === 2012-05-25 11:20:58,062 [c-40] INFO  ProxyHttpServletResponse - content-disposition set to: inline; fileName=Tempocasa_05-07-2012.pdf - unwrapping response output stream (CompressionFilter)
              === 2012-05-25 11:20:58,359 [c-40] DEBUG SQLTransaction - Ending dbEleven transaction "68465766"

              Comment


                #8
                Normally a request to view a file includes the filename in the request URL - it ends like IDACall/fileName.pdf. This cause your servlet engine to use the right content-type automatically. You seem to have changed something that's trimmed off the filename from the IDACall URL, creating this issue.

                Comment


                  #9
                  as usual, you're right.

                  I was trying to incorporate a specific parameter in all requests, as you've suggested in the past:
                  http://forums.smartclient.com/showpost.php?p=63412&postcount=11

                  actually in smartclient there aren't getActionUrl/setActionUrl methods, and I was (naively) doing
                  Code:
                      isc.RPCManager.addClassProperties({
                          actionURL:isc.RPCManager.actionURL + '?locale=' + '<%=locale%>'
                      });
                  is it possible to do this in a supported way with smartclient APIs?

                  Comment

                  Working...
                  X