Re: [Geoserver-users] REST or GUI in geoserver to find references to objects before deleting them or when replacing them

2016-12-20 Thread Andrea Aime
On Mon, Dec 19, 2016 at 10:38 PM, Brian Biales 
wrote:

> So my main question: Is there an easy way to find references of a Layer
> (or a Style or a Store or a Layer Group), so I don’t have to hunt them
> down?
>
Maybe try to delete it, you should get a "really want to do this" dialog
listing what will be modified.

And then, if not, perhaps this becomes an enhancement request.  And perhaps
> reposted to geoserver-devel?
>
Yep. Also have a look here:
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


> From a UI perspective, I would like to select the layer (or in the long
> run, a Style, a Store, or a Layer Group as well), and in addition to
> seeing the Data, Publishing, Dimensions, and Tile Caching tabs at the top,
> also include a “References” tab.  Go to this tab, and see the other
> things that reference it.  Perhaps even make these references a link, to
> go edit that object (to manually remove the reference, perhaps…).  For a
> Layer, it should include all Layer Groups that include it.  Perhaps any
> special security settings that reference it as well.  So I know that I
> need to go update these if I’m replacing the layer.  For Stores – perhaps
> it would show all published layers (even though this is pretty easy to find
> out in the Layer list).  Styles should also list what Layer Groups or
> Layers reference them.  (That’s not so easy to figure out)
>

Hmm... that seems to be a bit of a custom panel, like, what if someone has
a similar but slightly different need? Or centered on styles instead of
layers? Just saying :-)
Thinking out loud, the GeoServer catalog exposed a method to perform a
freeform query:

https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/catalog/Catalog.java#L1714

You basically set the type of desired object (e.g., FeatureTypeInfo) and a
filter based on its properties, and those of the nested objects. This could
be exposed to the UI as a sort of a query panel.
Thinking a bit further, the queries could be grouped in scripts and made
parametric (like in common sql clients). One step further and one could
maybe create a simple form language to enter the query parameters and thus
allow the creation of whatever search form your hearth desires. As said,
just thinking out loud here :-p

Of course the same could be exposed via the REST api and allow someone to
build custom forms via html/javascript.

Cheers
Andrea

-- 
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39  339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility  for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

---
--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel___

[Geoserver-users] REST or GUI in geoserver to find references to objects before deleting them or when replacing them

2016-12-19 Thread Brian Biales
Hi,
I've struggled with the best way to "replace" the data for a shape file
layer in Geoserver.  I receive new SHP files several times a year.  The
safest method I've found, if I want to keep the same layer name, is to
do the following:
1)  put the new SHP files into a new folder under the data_dir.  Each
new folder includes the date/month in the name.  Like ShpFiles_2016_12
2)  create a new store with the same name as the folder I put the files
in.

3)  rename the current layer.  For WMS queries that display this layer,
this layer is actually part of a Layer Group.  So renaming it really has
little effect on those using the Layer Group to view it.  However there
are Feature queries that use the actual layer name.  These will stop
working temporarily when I rename it.
4)  Add new layer, selecting the new store, and the new shp file, and
set the layer name to the original layer name.  Calculate the bounds,
and save.  Now the Feature queries will work, but the layer groups are
still pointing to the old layer...
5)  Now I have to go to all the Layer Groups that contain the old,
renamed layer, edit them, add the newly created layer, move it to the
right location in the hierarchy, then delete the older renamed layer,
and save.  Do this for each Layer Group that references the older,
renamed layer.
6) When I'm sure the older layers/stores are no longer referenced, I can
then delete them from Geoserver and delete the files from the data_dir.

So my main question: Is there an easy way to find references of a Layer
(or a Style or a Store or a Layer Group), so I don't have to hunt them
down?

And then, if not, perhaps this becomes an enhancement request.  And
perhaps reposted to geoserver-devel?

>From a UI perspective, I would like to select the layer (or in the long
run, a Style, a Store, or a Layer Group as well), and in addition to
seeing the Data, Publishing, Dimensions, and Tile Caching tabs at the
top, also include a "References" tab.  Go to this tab, and see the other
things that reference it.  Perhaps even make these references a link, to
go edit that object (to manually remove the reference, perhaps...).  For
a Layer, it should include all Layer Groups that include it.  Perhaps
any special security settings that reference it as well.  So I know that
I need to go update these if I'm replacing the layer.  For Stores -
perhaps it would show all published layers (even though this is pretty
easy to find out in the Layer list).  Styles should also list what Layer
Groups or Layers reference them.  (That's not so easy to figure out)  

It would be fantastic to have Geoserver help me determine that an object
is no longer referenced by others before I delete it.


Brian Biales
Telepartner International


--
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel___
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users