Spectrum Spatial (SSA/LIM)

 View Only
Expand all | Collapse all

Can I reference local files in the callout templates?

  • 1.  Can I reference local files in the callout templates?

    Posted 04-05-2018 02:06

    Hello again

    I've thrown together some templates and I have a column with local file names to some images. Can these be referenced in the call out template?

    I keep hitting errors. I figured it would error if a user didn't have permission but with full permissions they don't work either.

    I would really like the images to show up but I don't want to host them online.

    Any ideas? Or is this one completely unfeasible?

    Many thanks



  • 2.  RE: Can I reference local files in the callout templates?

    Employee
    Posted 04-04-2018 23:22

    Hi,

    Use-case design needs more thinking. Accessing Images on local desktop may not be the right thing, as this will not work for other users. Data should ideally be on server.

    Rahul Mahajan



  • 3.  RE: Can I reference local files in the callout templates?

    Posted 04-04-2018 23:27

    They are on the network drive that all users will have access to. They are not on the Spectrum server though



  • 4.  RE: Can I reference local files in the callout templates?

    Employee
    Posted 04-04-2018 23:30

    Ok, that sounds better. Is it possible to move the files relative to template path , i.e. within Spectrum SSA server. If yes, than all you need to do is try with the relative path. Given SSA is a web application running behind Tomcat server, files can only be accessed when the files are in the tomcat webapp path.

     

    Rahul Mahajn



  • 5.  RE: Can I reference local files in the callout templates?

    Posted 04-04-2018 23:34

    Hm ideally I wouldn't move any images because the images are inside other databases, so I'd have to double up on files.

    Also some of my tables already reference the right folders, so I'd have to create new file paths just for access by SSA

     



  • 6.  RE: Can I reference local files in the callout templates?

    Posted 04-04-2018 23:35

    And the photos are connected to specific rows in the table, so calling them up as per the example in the downloadable templates is no use, it needs to be the specific image with the specific polygon/point/etc

     



  • 7.  RE: Can I reference local files in the callout templates?

    Posted 04-05-2018 00:06

    OK as best as I can tell, browsers in general do not allow you to open locally hosted files as it is a security risk.

    So that explains why I can't get it to work. I'll need to look into alternatives now



  • 8.  RE: Can I reference local files in the callout templates?

    Employee
    Posted 04-05-2018 00:07

    Hi, one option is to expose the custom logic in a restful webservice. This service would help in encapsulating the logic of querying the database & retrieving image bytes in rest service response based on x,y (input from map to template)

    Rahul



  • 9.  RE: Can I reference local files in the callout templates?

    Posted 04-05-2018 00:18

    We're going to look into virtual directory



  • 10.  RE: Can I reference local files in the callout templates?

    Posted 04-05-2018 00:34

    IIS isn't installed on the server. @Pallavi Sharath?, Michael from IT said to check with you before we install IIS to make sure it doesn't break anything. Do you know if it is OK?

     

    Many thanks Rahul, I'll let you know if we get a solution!

     



  • 11.  RE: Can I reference local files in the callout templates?

    Posted 04-05-2018 01:13

    Hi Rebecca,

    Not 100% on this but another way may be to create a DFS name space and add that as a virtual drive that tomcat has readonly access to using the subst dos command.

    The DFS name space is where the magic is though as this can contain structure from multiple locations anywhere in your network and is dynamic and accessible via unc

    As its essentially dynamically updated unc the internals of your tab files should handle it ok if updated.

    cheers

     



  • 12.  RE: Can I reference local files in the callout templates?

    Posted 04-05-2018 01:18

    Is that the same as creating a virtual directory through IIS? I'm stretching my knowledge a bit trying to get around all this.



  • 13.  RE: Can I reference local files in the callout templates?

    Employee
    Posted 04-05-2018 08:43

    Hi Rebecca,

    running the IIS parallel to SSA and Spectrum is fine as long as the IIS is using a different port. Usually the IIS installs on port 80 which work if you have installed SSA and Spectrum on default ports. You would then create a virtual directory pointing to the folder with you images.

    Keep in mind that the IIS is running with the Windows network service account which might not have permissions to access the network folder. You can change IIS to use a different user through the application pool settings.



  • 14.  RE: Can I reference local files in the callout templates?

    Posted 04-08-2018 18:57

    Great thanks! I'll get IT to lend me a hand so it's set up OK. I'll come back and let everyone know if it works



  • 15.  RE: Can I reference local files in the callout templates?

    Posted 04-08-2018 19:35

    Hi Rebecca,

    Are you wanting to call/retrieve photo's and or pdf type documents which are referenced in a path within the attribute data? If so, our method was to setup an internal IIS web server, host all your docs or photos etc there and simply have the appropriate path in the attributes of each required object... Is that what you're after?



  • 16.  RE: Can I reference local files in the callout templates?

    Posted 04-08-2018 19:54

    Hi Tony, the IIS is exactly where I'm going. Just got to wait for IT to help it get it going.

    Great to know that's how you've done it!



  • 17.  RE: Can I reference local files in the callout templates?

    Posted 04-08-2018 19:57

    Yeah we only implemented a couple weeks ago, works well and is easy to update your attribute fields to accommodate the file address/location, SSA is definitely a different ball game than Exponare!!



  • 18.  RE: Can I reference local files in the callout templates?

    Posted 04-08-2018 20:00

    It sure is. When it works and doesn't throw errors no one has an answer for LOL!

    It will be great when it's all done and ready for use.



  • 19.  RE: Can I reference local files in the callout templates?

    Posted 04-25-2018 23:49

    @Rebecca Marks?  Were you able to crack this? I am curious to know the solution for these kind of challenges.

    -krishna.



  • 20.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 00:44
      |   view attached

    Hello!

    Funnily enough, just got IT to fix my access issue and now it works!

    Used IIS to host the photos and now when you click on an item that has an image it calls up the filepath and posts it in the legend. Just doing a couple of tweaks now - need to change the text that says the photos aren't available yet

     

    example

     



  • 21.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 00:46

    Small issue with the wider photos being squashed into the frame I've provided. I might have to select other photos for some items

     



  • 22.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 00:54

    And I've hit another wall, the photos are view-able on the Spectrum server but not through an individual login. Better get back onto IT re permissions



  • 23.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 04:20

    @Rebecca Marks? Thats sounds great! Can you tell us how did you kept the file path? I meant to ask is it dynamic like other attribute date?

    {{feature.dbcolumn.value}}... Where DB column will have the path of the image.. Am i correct?



  • 24.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 19:17

    Sure

    So you use IIS to set up a pretend webpage. In IIS you can add directories. I added the folder that contained the files. The new files goes from your standard file path to looking like this;

    http://localhost:8040/Heritage/filename.jpg

    So it looks like a webpage, but it is hosted locally (port 8040), the directory is called "Heritage" and the file is at the end.

    I didn't have to move any files and adding this file path to the table means you can call it up in the HTML to display in the sidebar. To add more images for different tables or columns from another location I just add another directory to the existing "web page" that points to another folder.

    (So it would be http://localhost:8040/Bridges/filename.jpg)

    The biggest challenge was getting the program permissions to access files on different servers. I had to leave that part up to IT to figure out.

    Here's the html for calling the column the image file path is in, and setting a default size;

    <li class="customCalloutData" style="margin-top: 10px;font-size: 14px">

    <img src="{{feature.Photo1.value}}" width="500" height="377">

    </li>

     

     And yes, "Photo1" is the name of the column the file paths live in



  • 25.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 20:07

    @Rebecca Marks? is that "http://localhost" working across your network? We've had to use always use the full server name when referencing files else it won't link correctly on anything other than the computer the server is sitting on. Its not an area I'm much familiar with though so perhaps another can advise.

     

    This is the image tag we use;

    <img src="{{feature.Photo_Path.value}}" alt="Link to image" style="max-width: 100%; height: auto;">

    Substitute your own attribute value in but if you use the rest of that it should automatically resize the image to the information panel as the user enlarges or shrinks it or uses it on different devices.



  • 26.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 20:14

    Great thanks!

    No it doesn't work off the server, which is where I'm stuck again. I'll give that a go and see if it fixes it! Thanks

    Also going to try the photo width thing too - the photos aren't uniform and it's really distorting some of them



  • 27.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 20:25

    Alright image width fixed, I've used the following. So all photos have a fixed width but a scale-able height.

     

    <li class="customCalloutData" style="margin-top: 10px;font-size: 14px">

    <img src="{{feature.Photo2.value}}" width = "500" height: auto;">

    </li>

     



  • 28.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 20:55

    Try running it with the style="max-width: 100%; height; auto;" it will read each image's dimensions separately rather than forcing the image to conform to the 500 pixel width you are currently specifying. The size style as above will fit the image to the information panel so you will always see all the image regardless of the size you shrink/enlarge the info panel too.

    Another tip with the server name. Once you change the file path from localhost:8040 to yourservername:8040 it may be worth further adjusting it to yourservername.organisationdomain.com:8040 we found some devices IT setup accessed the network differently and needed a fully qualified server path else they couldn't see the images either.



  • 29.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 20:56

    @William Dean? - I tired changing it to the server name, it didn't work

     

    Also setting the photos the way you suggest makes them gigantic and take up the whole screen. That's why I needed to control width.



  • 30.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 21:18

    Tried yourservername.organisationdomain.com:8040 too, no good.



  • 31.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 21:18
      |   view attached

    @Rebecca Marks? not sure why the width would be doing that, definitely using max-width and not just width? Attached pic is that same code implemented in one of our layers. Normal view is on the right hand side then by dragging the panel toggle you can enlarge the pictures as shown on left.image_resize

     

    I don't know how you've setup the IIS but the localhost vs server-name is going to be one problem you'll need help from IT to address.



  • 32.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 21:23

    Hm, I redid it and it worked this time. Maybe I missed the style part? Thanks for that

    Interesting to see that they don't come across on the print template? That's a bit inconvenient

     

    Still no luck with the filepath



  • 33.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 21:34

    FIXED!

    Firewall exception on the server. Once fixed just the servername, no domain needed

    Thankyou so much for your help

     



  • 34.  RE: Can I reference local files in the callout templates?

    Posted 04-26-2018 22:55

    Good to hear. Wasn't sure if you would need the domain name, we can get by without it for 99% of devices there are just a few that require it.