[Geoserver-devel] An interactive file chooser for store creation in GeoServer

Hi,
lately I've been doing a GeoServer workshop and I suffered watching students
stumble across some of the GeoServer GUI deficiencies.

One of them is the lack of a file chooser when creating
shapefile/directory/raster
stores. Having to copy and paste the path, and sometimes make it relative
to the data directory, is error prone and generally annoying.

The patch I've attached to http://jira.codehaus.org/browse/GEOS-4208 is meant
to solve the issue.
It provides a set of custom store panels for shapefiles, directory and
rasters that
come with a file chooser showing the server side file system and allowing to
choose a path by point and click.

I've made a quick screencast (sorry for the pitiful voice part of it)
showing how that
works:
http://demo.geo-solutions.it/share/chooser.ogv
(in order to view it outside of a Linux machine I suggest you install VideoLan,
it's good and can play the OGG vorbis format the screencast is made with)

If you can't see the screencast I've also attached a few screenshots to this
mail.

Highlights:
- allows to chose both files and directories
- provides quick access to user home and the data directory
- it is data directory aware, so it will generate path that are relative to it
  if you pick anything inside of $GEOSERVER_DATA_DIR/data

Feedback welcomed. I'd like to commit this improvements soon,
reviews for the patch I've attached to http://jira.codehaus.org/browse/GEOS-4208
are also welcomed

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

(attachments)

fc_shapefile-nq8.png
fc_shapefilec-nq8.png
fc_relativedir-nq8.png
fc_shapefilec-nq8.png

Awesome! This is probably long overdue. :slight_smile: In the pull-down menu in the video, I see "Data directory", "Home directory" and "/". What will display for the Windows users?

My hope is that it will be: data directory, home directory, and all of the roots of the drives (C:\, D:\, etc.)

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

On 11/3/2010 6:41 AM, Andrea Aime wrote:

Hi,
lately I've been doing a GeoServer workshop and I suffered watching students
stumble across some of the GeoServer GUI deficiencies.

One of them is the lack of a file chooser when creating
shapefile/directory/raster
stores. Having to copy and paste the path, and sometimes make it relative
to the data directory, is error prone and generally annoying.

The patch I've attached to http://jira.codehaus.org/browse/GEOS-4208 is meant
to solve the issue.
It provides a set of custom store panels for shapefiles, directory and
rasters that
come with a file chooser showing the server side file system and allowing to
choose a path by point and click.

I've made a quick screencast (sorry for the pitiful voice part of it)
showing how that
works:
http://demo.geo-solutions.it/share/chooser.ogv
(in order to view it outside of a Linux machine I suggest you install VideoLan,
  it's good and can play the OGG vorbis format the screencast is made with)

If you can't see the screencast I've also attached a few screenshots to this
mail.

Highlights:
- allows to chose both files and directories
- provides quick access to user home and the data directory
- it is data directory aware, so it will generate path that are relative to it
   if you pick anything inside of $GEOSERVER_DATA_DIR/data

Feedback welcomed. I'd like to commit this improvements soon,
reviews for the patch I've attached to http://jira.codehaus.org/browse/GEOS-4208
are also welcomed

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

This body part will be downloaded on demand.

This body part will be downloaded on demand.

On Wed, Nov 3, 2010 at 3:17 PM, Mike Pumphrey <mike@anonymised.com> wrote:

Awesome! This is probably long overdue. :slight_smile: In the pull-down menu in the
video, I see "Data directory", "Home directory" and "/". What will display
for the Windows users?

Who knows, I don't use windows :-p

My hope is that it will be: data directory, home directory, and all of the
roots of the drives (C:\, D:\, etc.)

Yeah, I coded it that way and hope it works, but I cannot be sure

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

Awesome stuff, a very welcome improvement for sure. +1.

On Wed, Nov 3, 2010 at 8:45 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Nov 3, 2010 at 3:17 PM, Mike Pumphrey <mike@anonymised.com> wrote:

Awesome! This is probably long overdue. :slight_smile: In the pull-down menu in the
video, I see “Data directory”, “Home directory” and “/”. What will display
for the Windows users?

Who knows, I don’t use windows :-p

My hope is that it will be: data directory, home directory, and all of the
roots of the drives (C:, D:, etc.)

Yeah, I coded it that way and hope it works, but I cannot be sure

Cheers
Andrea


Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf



Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware,
phishing sites, and compromised hosts - saving your company time,
money, and embarrassment. Learn More!
http://p.sf.net/sfu/hpdev2dev-nov


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Wed, Nov 3, 2010 at 3:45 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Wed, Nov 3, 2010 at 3:17 PM, Mike Pumphrey <mike@anonymised.com> wrote:

Awesome! This is probably long overdue. :slight_smile: In the pull-down menu in the
video, I see "Data directory", "Home directory" and "/". What will display
for the Windows users?

Who knows, I don't use windows :-p

My hope is that it will be: data directory, home directory, and all of the
roots of the drives (C:\, D:\, etc.)

Yeah, I coded it that way and hope it works, but I cannot be sure

Anyways, when I check in the change, can you give it a spin on windows
and let me know?
The ability to manually type a path remains, so worst case the file chooser
would be working below par for windows user (which, I agree,
are kind of the main use case for this).
Of course if there is any windows based developer that wants to help
right away, don't be shy, the patch is there for everybody to see and
improve :-p

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

Anyways, when I check in the change, can you give it a spin on windows
and let me know?

Of course. Just let me know when it drops, and I'll pull a nightly.

Thanks,
Mike Pumphrey, Defender of GeoServer on Windows
OpenGeo - http://opengeo.org

On 11/3/2010 11:31 AM, Andrea Aime wrote:

On Wed, Nov 3, 2010 at 3:45 PM, Andrea Aime
<andrea.aime@anonymised.com> wrote:

On Wed, Nov 3, 2010 at 3:17 PM, Mike Pumphrey<mike@anonymised.com> wrote:

Awesome! This is probably long overdue. :slight_smile: In the pull-down menu in the
video, I see "Data directory", "Home directory" and "/". What will display
for the Windows users?

Who knows, I don't use windows :-p

My hope is that it will be: data directory, home directory, and all of the
roots of the drives (C:\, D:\, etc.)

Yeah, I coded it that way and hope it works, but I cannot be sure

Anyways, when I check in the change, can you give it a spin on windows
and let me know?
The ability to manually type a path remains, so worst case the file chooser
would be working below par for windows user (which, I agree,
are kind of the main use case for this).
Of course if there is any windows based developer that wants to help
right away, don't be shy, the patch is there for everybody to see and
improve :-p

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

On Wed, Nov 3, 2010 at 4:36 PM, Mike Pumphrey <mike@anonymised.com> wrote:

Anyways, when I check in the change, can you give it a spin on windows
and let me know?

Of course. Just let me know when it drops, and I'll pull a nightly.

Just committed. Let me know how it works :slight_smile:

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

I just fired this thing up, and it works well, with one hitch. I see four entries in the drop down:

   Data directory
   Home directory
   C:
   D:

(It even included the volume names of each drive, nice). The hitch is that the Home directory displays the root of C:, not my home directory (defined in %USERPROFILE%) like I would expect.

Aside from that, it's a great and long-overdue enhancement to the UI. Thanks for putting this together!

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

On 11/4/2010 12:16 PM, Andrea Aime wrote:

On Wed, Nov 3, 2010 at 4:36 PM, Mike Pumphrey<mike@anonymised.com> wrote:

Anyways, when I check in the change, can you give it a spin on windows
and let me know?

Of course. Just let me know when it drops, and I'll pull a nightly.

Just committed. Let me know how it works :slight_smile:

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

On Fri, Nov 5, 2010 at 10:27 PM, Mike Pumphrey <mike@anonymised.com> wrote:

I just fired this thing up, and it works well, with one hitch. I see four
entries in the drop down:

Data directory
Home directory
C:
D:

(It even included the volume names of each drive, nice). The hitch is that
the Home directory displays the root of C:, not my home directory (defined
in %USERPROFILE%) like I would expect.

Interesting. What is the user running GeoServer? Is it running as a service?
The "home" of the user that's administering the server makes no sense,
as that user might be on another machine and its OS level user name
is not known anyways. What you get should be the home of the user
that is running geoserver instead. If it's running as a service it might be
that the home in that case is C:/ (I guess I should compare the home
directory with the various file system roots, and if it's equal to one of
them, remove the home from the list)

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

Right you are, Andrea; I had this running in Tomcat, which is indeed installed as a service.

Just tried again running as "me" (had to get over the mental block of doing it this way, which always involves debugging for me). And the home directory works as advertised. The only thing I notice that's a bit odd is the displayed directories. The home directory is displayed for me only as "Mike/". It would be nice if the full path were displayed there, and not just that one directory. Ditto with the Data directory, which only shows "data_dir/". That may be a matter of prompt taste (my prompt has the full path at all times), but since the folder chooser drills down and displays multiple directories as it goes ("data_dir/ data/"), it would be nice to be consistent.

As for the service situation, if you could remove duplicates from the list, that would be a bonus. Home directory doesn't have much meaning in a service context.

Hope this feedback helps.

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

On 11/5/2010 5:46 PM, Andrea Aime wrote:

On Fri, Nov 5, 2010 at 10:27 PM, Mike Pumphrey<mike@anonymised.com> wrote:

I just fired this thing up, and it works well, with one hitch. I see four
entries in the drop down:

   Data directory
   Home directory
   C:
   D:

(It even included the volume names of each drive, nice). The hitch is that
the Home directory displays the root of C:, not my home directory (defined
in %USERPROFILE%) like I would expect.

Interesting. What is the user running GeoServer? Is it running as a service?
The "home" of the user that's administering the server makes no sense,
as that user might be on another machine and its OS level user name
is not known anyways. What you get should be the home of the user
that is running geoserver instead. If it's running as a service it might be
that the home in that case is C:/ (I guess I should compare the home
directory with the various file system roots, and if it's equal to one of
them, remove the home from the list)

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

On Thu, Nov 11, 2010 at 4:39 PM, Mike Pumphrey <mike@anonymised.com> wrote:

Right you are, Andrea; I had this running in Tomcat, which is indeed
installed as a service.

Just tried again running as "me" (had to get over the mental block of doing
it this way, which always involves debugging for me). And the home
directory works as advertised.

Ok, then I have to remove it in case the home is equal to one of the other roots

The only thing I notice that's a bit odd is
the displayed directories. The home directory is displayed for me only as
"Mike/". It would be nice if the full path were displayed there, and not
just that one directory. Ditto with the Data directory, which only shows
"data_dir/". That may be a matter of prompt taste (my prompt has the full
path at all times), but since the folder chooser drills down and displays
multiple directories as it goes ("data_dir/ data/"), it would be nice to be
consistent.

I disagree on this one. The paths are presented relative to the home directory,
and relative to the data directory on purpose. What you have in the dropdown
is a set of roots, not a set of bookmarks.
There already not much space in the file chooser, having it
display "c:\documents and settings\" would waste quite a bit of it.

In the specific case of the data directory the paths you get back from the
chooser are relative, so it makes sense to show them as relative as well.

As for the service situation, if you could remove duplicates from the list,
that would be a bonus. Home directory doesn't have much meaning in a
service context.

Yup, agreed.

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------

I disagree on this one. The paths are presented relative to the home directory,
and relative to the data directory on purpose. What you have in the dropdown
is a set of roots, not a set of bookmarks.
There already not much space in the file chooser, having it
display "c:\documents and settings\" would waste quite a bit of it.

No biggie, it was a minor point. And you're right, when the path gets too long it wouldn't be a good thing. Sold!

Thanks,
Mike Pumphrey
OpenGeo - http://opengeo.org

On 11/12/2010 9:05 AM, Andrea Aime wrote:

On Thu, Nov 11, 2010 at 4:39 PM, Mike Pumphrey<mike@anonymised.com> wrote:

Right you are, Andrea; I had this running in Tomcat, which is indeed
installed as a service.

Just tried again running as "me" (had to get over the mental block of doing
it this way, which always involves debugging for me). And the home
directory works as advertised.

Ok, then I have to remove it in case the home is equal to one of the other roots

   The only thing I notice that's a bit odd is
the displayed directories. The home directory is displayed for me only as
"Mike/". It would be nice if the full path were displayed there, and not
just that one directory. Ditto with the Data directory, which only shows
"data_dir/". That may be a matter of prompt taste (my prompt has the full
path at all times), but since the folder chooser drills down and displays
multiple directories as it goes ("data_dir/ data/"), it would be nice to be
consistent.

I disagree on this one. The paths are presented relative to the home directory,
and relative to the data directory on purpose. What you have in the dropdown
is a set of roots, not a set of bookmarks.
There already not much space in the file chooser, having it
display "c:\documents and settings\" would waste quite a bit of it.

In the specific case of the data directory the paths you get back from the
chooser are relative, so it makes sense to show them as relative as well.

As for the service situation, if you could remove duplicates from the list,
that would be a bonus. Home directory doesn't have much meaning in a
service context.

Yup, agreed.

Cheers
Andrea

-----------------------------------------------------
Ing. Andrea Aime
Senior Software Engineer

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584962313
fax: +39 0584962313

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-----------------------------------------------------