What sholud I do for using heron.cgi at glassfish 4.1

93 views
Skip to first unread message

Aissam AKHBAZ

unread,
May 9, 2015, 6:38:39 AM5/9/15
to geoext-vi...@googlegroups.com
I am trying to use download option of heron. I have to use heron.cgi. I did   
something and I didnt get good result for this. 
I am using glassfish 4.1 version. What must i do for using download esri   
shape file option ? I spent a lot of time tying ti find any thing but in vain, Can anyone explain it step by step ? Because in the   
documentation there is no quite enough information about heron.cgi. Please   
help me for this problem, It's urgent I'm going to be fired from my work

Davor Racic

unread,
May 9, 2015, 8:41:04 AM5/9/15
to geoext-vi...@googlegroups.com
We had a discussion about runnig cgi scripts in Tomcat environment:


It wouldn't be much different doing the same in glassfish:

Davor Racic

unread,
May 9, 2015, 8:42:28 AM5/9/15
to geoext-vi...@googlegroups.com

Aissam AKHBAZ

unread,
May 9, 2015, 10:25:44 AM5/9/15
to geoext-vi...@googlegroups.com

Hello,
Thanks a lot for your rich response, so after following the links that you sent, and the tomcat discussion. all works fine, :)  
 BUT I still have problems, for example after downloading a file for example xls format the output has always .cgi extension, when I changed .cgi to .xls the file works fine, for json Format the result is given in a new onglet of my browser  here is the results in captures .


BUT the bigest problem is for shp format I got this :

Note that I added to heron.cgi OGR2OGR_PROG = 'C:\OSGeo4W\bin\ogr2ogr' as path where ogr2ogr.exe exist.

I hope that I am clear!. Thanks for your collaboration



Le samedi 9 mai 2015 13:42:28 UTC+1, Davor Racic a écrit :

Davor Racic

unread,
May 9, 2015, 10:46:39 AM5/9/15
to geoext-vi...@googlegroups.com
Look at popenargs at the bottom - "C:\\OSGeo4W\x08in\\ogr2ogr", so i suppose you put only one backslash in front of "bin", so instead of escape sequence for "\" you got "\b" or "x08" which is escape sequence for backspace. 

As for .xls problem - you should google for MIME types in glassfish - .xls should be application/octet-stream. This is not a Heron specific problem - it is a web server issue.

Aissam AKHBAZ

unread,
May 9, 2015, 1:18:27 PM5/9/15
to geoext-vi...@googlegroups.com
Thanks!  I resolved the problem of .shp, I did a mistake in the path of ogr2ogr It worked when I changed it to OGR2OGR_PROG = 'C:/OSGeo4W/bin/ogr2ogr'.
Now for MIME types I dont have any idea, I found in the file default-web.xml 
<mime-mapping>
    <extension>xls</extension>
    <mime-type>application/vnd.ms-excel</mime-type>
  </mime-mapping>
and this file is general for all projects!!! but I get always .cgi extension in the downloaded files.

2015-05-09 15:46 GMT+01:00 Davor Racic <davor...@gmail.com>:
Look at popenargs at the bottom - "C:\\OSGeo4W\x08in\\ogr2ogr", so i suppose you put only one backslash in front of "bin", so instead of escape sequence for "\" you got "\b" or "x08" which is escape sequence for backspace. 

As for .xls problem - you should google for MIME types in glassfish - .xls should be application/octet-stream. This is not a Heron specific problem - it is a web server issue.

--
--
You received this message because you are subscribed to the Google
Groups "geoext-viewer-devel" group.
To post to this group, send email to
geoext-vi...@googlegroups.com
To unsubscribe from this group, send email to
geoext-viewer-d...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/geoext-viewer-devel?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Heron Mapping Client Development" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/geoext-viewer-devel/b10beLub_HQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to geoext-viewer-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
------------------------------------------------------------------------------------------------
Aissam AKHBAZ,
Elève ingénieur en Sciences de l'Information Géographique (SIG),
ECOLE HASSANIA DES TRAVAUX PUBLICS (EHTP),

Aissam AKHBAZ

unread,
May 11, 2015, 9:09:44 AM5/11/15
to geoext-vi...@googlegroups.com
Hello, 
Could you please explain  ".xls should be application/octet-stream." and how to do it in glassfish?

Davor Racic

unread,
May 11, 2015, 11:16:12 AM5/11/15
to geoext-vi...@googlegroups.com
You should send default-web.xml file from your glassfish application instalation. That file should have something like:

    <mime-mapping> <extension>zip</extension> <mime-type>application/zip</mime-type> </mime-mapping> <mime-mapping> <extension>xls</extension> <mime-type>application/vnd.ms-excel</mime-type> </mime-mapping>
    <mime-mapping>
        <extension>kml</extension>
        <mime-type>application/vnd.google-earth.kml+xml</mime-type>
    </mime-mapping>
<mime-mapping> <extension>gpx</extension> <mime-type>application/gpx+xml</mime-type> </mime-mapping>

A MIME attachment with the content type "application/octet-stream" is a binary file. Typically, it will be an application or a document that must be opened in an application, such as a spreadsheet or word processor. So you can use it for XLS files, but you can also use more specific application/vnd.ms-excel like in my Tomcat example. 

If the mime-mapping is not specified in web.xml, GlassFish Server attempts to determine the MIME type from default-web.xml or the operating system default, and that is usually text/html. Find yourself other MIME mappings for other extensions you need.

In another words - when you requst something from a web server, in a response  you get "content-type" response header, something that your browser uses for interpreting what to do with the response.






Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages