Enhanced Search - Link to documents

2511
4
Jump to solution
06-26-2012 12:49 PM
JaredCollier
New Contributor II
I have been fiddling with adding and modifying widgets for a month or so now and I am to the point with this Enhanced Search Widget that I think I need some feedback to determine if what I want to accomplish is even possible. Ultimately my goal is to have a query builder like the Selection Widget or a modified Enhanced Search Widget in Flex Viewer 3.0 where you can link to a defined pdf document on the local network.  One caveat is that I need the pdf to open in its native location on the network not in the temp files of the computer it is being access by the widget.  This is due to the fact that many other pdf documents are linked from the initial pdf being accessed and the links are defined by relative location. So if the first pdf opens in the temp folder the links are broken.  In previous situations this was handled by using the following string  "file://///MachineName/folder/folder/file.pdf".

My question is in regard to the possibility of either the Enhanced Search Widget (with these modifications http://forums.arcgis.com/threads/60812-Enhanced-Search-Widget-Searching-Multiple-Fields?p=210001&vie...) or the Selection Widget link capabilities to open the pdf documents at the file location and not the temporary location.  Is it possible given the following information I have discovered:

In Firefox(13.0.1) the link in both Enhanced(2.9 & 3.0) and Selection Widgets do nothing when I click the hyperlink with the "file:///..." syntax.  I found that firefox doesn't allow them without workarounds.  FYI - they do open in temp location with normal url"//machinename/folder/folder/file.pdf".

http://en.wikipedia.org/wiki/File_URI_scheme

In IE(9.0.8112...) the following error pops up:

          Adobe Flash Player
          An ActionScript error has occurred:

SecurityError: Error #2148: SWF file http://MachineName/flexviewer2.5_selectionwidget/widgets/InfoTemplates/InfoPopupWidget.swf cannot access local resource file://///MachineName/Flexviewer2.5_SelectionWidget/INFO/file.pdf. Only local-with-filesystem and trusted local SWF files may access local resources.
at global/flash.net::navigateToURL()
at widgets.InfoTemplates::InfoPopupWidget/showLink()
at widgets.InfoTemplates::InfoPopupWidget/__infoLink_click()

And

          Adobe Flash Player
          An ActionScript error has occurred:
SecurityError: Error #2148: SWF file http:/MachineName/flexviewer_esearch3.0/widgets/eSearch/SearchWidget.swf cannot access local resource file://///MachineName/Flexviewer_eSearch2.9/INFO/file.pdf. Only local-with-filesystem and trusted local SWF files may access local resources.
at global/flash.net::navigateToURL()
at widgets.eSearch::SearchResultItemRenderer/showLink()


I found the following information regarding this situation: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf6167e-7fff.html

I was wondering if changing the sandbox settings as referred to here might help or adding the swf to a trusted list somewhere that allows it to complete the action,

   If the SWF files are in different sandboxes (for example, if one SWF file was loaded from the local file system and the other from a network) they must adhere to the following set of rules:
      
     - Remote SWF files (those served over HTTP and other non-local protocols) can never load local SWF files.
     - Local-with-networking SWF files can never load local-with-filesystem SWF files, or vice versa.
     - Local-with-filesystem SWF files can never load remote SWF files.
     - Local-trusted SWF files can load SWF files from any sandbox.

I am sorry to put so much here, trying to anticipate any follow up questions
Jared
Tags (2)
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Jared,

   So... You have already tested to see the using a virtual directory to the UNC or physical path does not work with your relative paths in the pdfs..?

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Jared,

   So... You have already tested to see the using a virtual directory to the UNC or physical path does not work with your relative paths in the pdfs..?
0 Kudos
JaredCollier
New Contributor II
Jared,

   So... You have already tested to see the using a virtual directory to the UNC or physical path does not work with your relative paths in the pdfs..?



I have not, so to do this in IIS I would create a VD under my default website(inetpub\wwwroot).  I will call it "VD1" and locate it physically at C:\VD1 and the Virtual Path would be /VD1.
Where would I go then from here assuming that it correct.  Does my flexviewer application code go in the VD1 Physical Location or stay in the wwwroot?  I will put the Pdf's in VD1 Physical Location?  Then change my flex linkfields to file://///MachineName/VD1/folder/file.pdf

I have a feeling I am learning a valuable bit of knowledge here, I have not worked much with network and IIS until recently so I am in the midst of a crash course with more crash than course.  I will look into resources for working with virtual directories asap.

Thanks Robert, I am amazed at the amount of help you provide to other users!

Jared

Follow up: I am making some headway, I will complete testing tomorrow and post my results, thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jared,

   So I am not sure if you figured this out or not but once you create a virtual directory then you get a valid url that you can use as the link (i.e. http://someserver/somedirectory/mypdf.pdf).
0 Kudos
JaredCollier
New Contributor II
Jared,

   So I am not sure if you figured this out or not but once you create a virtual directory then you get a valid url that you can use as the link (i.e. http://someserver/somedirectory/mypdf.pdf).



Reporting back with some of the behavior I have discovered.  One I got the virtual directory configured and working just fine, that was my major hangup with getting the pdf files to open at the file location and not in a temporary location.  One of the biggest variables has been the browser being used.

In Firefox I don't think opening the file is possible without some work around, I get an Action Script Error:

'SecurityError: Error #2148: SWF file http://machinename/flexviewer_esearch3.0_VD/widgets/...swf cannot access local resource \\machinename\VirturalDirectoryFolder\INFO\Filename.pdf. Only local-with-filesystem and trusted local SWF files may access local resources.'


In Internet Explorer I get different results for the two link locatioins:

Using the following code format the pdf files open correctly from the results:

                        <fields all="false">
    <field name="StructureName" gridfield="true" />
    <field name="Structure_Rating" gridfield="true" />
    <field name="Filename" gridfield="true" alias="Structure Infomation Sheet" hyperlinkgridfield="true" hyperlinkaliastext="Get Infomation Sheet" linkprefix="\\machinename\VirturalDirectoryFolder\INFO\"/>
   </fields>


But using the following code format the pdf files do not open correctly from the popup: 

This is what I get, a blank IE tab looking the following: http://machinename/flexviewer_esearch3.0_VD/%5C%5Cmachinename%5CVirturalDirectoryFolder%5CINFO%5CFil...
It is essentially looking for http://machinename/flexviewer_esearch3.0_VD/\\machinename\VirturalDirectoryFolder\INFO\Filename.pdf

                        <links>
    <link alias="Structure Info Sheet">
     <![CDATA[\\machinename\VirturalDirectoryFolder\INFO\{Filename}]]>
     <icon><![CDATA[assets/images/w_link.png]]></icon>
    </link>
   </links>
Any obvious reason for this?


I have the desired results working on the Selection Widget.

Thanks for pointing me in the right direction with the Virtual Directory!

Jared
0 Kudos