https://github.com/geoserver/geoserver/pull/2592

Regards,

Alessio Fabiani

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

Ing. Alessio Fabiani

@alfa7691
Founder/Technical Lead


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

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.

On Thu, Oct 12, 2017 at 3:06 PM, Alessio Fabiani <
[email protected]> wrote:

> I no one is working on this I can spend some time to do a PR.
> Maybe if we can just share few ideas on possible solutions so I can move
> on the right direction.
> Most of the fixes should be quite straight.
>
> Regards,
>
> Alessio Fabiani
>
> ==
> GeoServer Professional Services from the experts! Visit
> http://goo.gl/it488V for more information.
> ==
>
> Ing. Alessio Fabiani
>
> @alfa7691
> Founder/Technical Lead
>
>
> GeoSolutions S.A.S.
> Via di Montramito 3/A
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313 <0584%20962313>
> fax:     +39 0584 1660272 <0584%20166%200272>
> mob:   +39 331 6233686 <331%20623%203686>
>
> 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.
>
> On Wed, Oct 11, 2017 at 7:10 PM, Alessio Fabiani <alessio.fabiani@geo-
> solutions.it> wrote:
>
>> In particular:
>>
>> 1)
>> here
>>
>> https://github.com/geoserver/geoserver/blob/master/src/restc
>> onfig/src/main/java/org/geoserver/rest/catalog/AbstractStore
>> UploadController.java#L109
>>
>> ZIP file containing the shapefiles are extracted on a folder named
>> *$GEOSERVER_DATA_DIR\data\{$workspace}\{$store_name}* without actually
>> removing the old ones, but only checking for old ZIP files with the same
>> name
>>
>>
>> 2)
>> here
>>
>> https://github.com/geoserver/geoserver/blob/master/src/restc
>> onfig/src/main/java/org/geoserver/rest/catalog/AbstractStore
>> UploadController.java#L114
>>
>> becomes the Directory, since a ShapefileDirectoryDataStore is created.
>> however the uploadedFile will never becomes null
>>
>> 3)
>> here
>>
>> https://github.com/geoserver/geoserver/blob/master/src/restc
>> onfig/src/main/java/org/geoserver/rest/catalog/AbstractStore
>> UploadController.java#L130
>>
>> nevertheless "files" already contains the correct list of shapefiles (and
>> ancillary files) I uploaded, those are cleared and replace with uploadedFile
>> which is now the directory containing all data uploaded until now
>>
>> 4)
>> here
>>
>> https://github.com/geoserver/geoserver/blob/master/src/restc
>> onfig/src/main/java/org/geoserver/rest/catalog/DataStoreFile
>> Controller.java#L232
>>
>> the folder is returned and the ShapefileDataStoreFactory created
>>
>> 5)
>> finally here
>>
>> https://github.com/geoserver/geoserver/blob/master/src/restc
>> onfig/src/main/java/org/geoserver/rest/catalog/DataStoreFile
>> Controller.java#L416
>>
>> for a reason that I really could not understand, unless the parameter 
>> configure
>> is equal "all" (meaning that I want everything to be configured again),
>> it configures just the first featureTypeName of the list.
>>
>> But even worse, previously
>>
>> https://github.com/geoserver/geoserver/blob/master/src/restc
>> onfig/src/main/java/org/geoserver/rest/catalog/DataStoreFile
>> Controller.java#L348
>>
>> it reloads ALL the tables on the DB. Such method may be potentially
>> dangerous when this folder contains hundreds of uploaded shapefiles and/or
>> very huge ones.
>>
>>
>>
>>
>> Regards,
>>
>> Alessio Fabiani
>>
>> ==
>> GeoServer Professional Services from the experts! Visit
>> http://goo.gl/it488V for more information.
>> ==
>>
>> Ing. Alessio Fabiani
>>
>> @alfa7691
>> Founder/Technical Lead
>>
>>
>> GeoSolutions S.A.S.
>> Via di Montramito 3/A
>> 55054  Massarosa (LU)
>> Italy
>> phone: +39 0584 962313 <0584%20962313>
>> fax:     +39 0584 1660272 <0584%20166%200272>
>> mob:   +39 331 6233686 <331%20623%203686>
>>
>> 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.
>>
>> On Wed, Oct 11, 2017 at 6:20 PM, Alessio Fabiani <
>> [email protected]> wrote:
>>
>>> Hi Andrea,
>>> currently I tested only version 2.12.x, but I guess the same happens on
>>> 2.11 and 2.13.
>>>
>>> Cannot say if that worked before. I noticed this behavior while trying
>>> to update the GeoServer version for GeoNode from 2.10 to 2.12. On GeoNode
>>> there were no changes on the REST calls, and we never faced such issue
>>> previously. Therefore I'm guessing it is something new.
>>>
>>> Currently I did debug of the code step by step and tried almost all
>>> combinations, but at this stage there is no way to add just one shapefile
>>> to a DB DataStore without modifying the code. If I correctly interpreted
>>> the logic, I guess it must be deeply revised. There something very strange
>>> on the way the workflow is managed on this use case.
>>>
>>>
>>> Regards,
>>>
>>> Alessio Fabiani
>>>
>>> ==
>>> GeoServer Professional Services from the experts! Visit
>>> http://goo.gl/it488V for more information.
>>> ==
>>>
>>> Ing. Alessio Fabiani
>>>
>>> @alfa7691
>>> Founder/Technical Lead
>>>
>>>
>>> GeoSolutions S.A.S.
>>> Via di Montramito 3/A
>>> 55054  Massarosa (LU)
>>> Italy
>>> phone: +39 0584 962313 <0584%20962313>
>>> fax:     +39 0584 1660272 <0584%20166%200272>
>>> mob:   +39 331 6233686 <331%20623%203686>
>>>
>>> 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.
>>>
>>> On Wed, Oct 11, 2017 at 6:13 PM, Andrea Aime <
>>> [email protected]> wrote:
>>>
>>>> Hi Alessio,
>>>> looking at the mail I have a hint of what you're talking about, but it
>>>> would be useful to add some details to
>>>> understand where to look into.
>>>> What exact REST request are you running? (important as there are
>>>> several ways to create a store, like,
>>>> I would believe that pointing the code to a existing folder is not the
>>>> same as uploading a zip file, and so on).
>>>>
>>>> Also, is the issue happening on 2.12, and is it unique to it? (since
>>>> the REST API has been rewritten there)
>>>>
>>>> Cheers
>>>> Andrea
>>>>
>>>>
>>>> On Tue, Oct 10, 2017 at 3:53 PM, Alessio Fabiani <
>>>> [email protected]> wrote:
>>>>
>>>>> Dear all,
>>>>> while testing REST upload of resources against a PostGIS DataStore I
>>>>> faced on a quite severe issue on DataStoreFileController.
>>>>>
>>>>> If you look at the code workflow, in the unlucky case you would like
>>>>> to add a shapefile to a datastore, this methods either fails if the
>>>>> shapefile is not the first file on the target folder or reloads the whole
>>>>> directory into the database. The biggest issue is that there's no way to
>>>>> force a cleanup of this directory, named like the datasotre, thus ending 
>>>>> up
>>>>> reloading also very old shapefiles.
>>>>>
>>>>> How exactly this method is ment to be used? What the use case for its
>>>>> implementation? It would be possible at least to add an option to take 
>>>>> into
>>>>> account just the files I'm uploading instead of forcing me to reload the
>>>>> whole directory?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Alessio Fabiani
>>>>>
>>>>> ==
>>>>> GeoServer Professional Services from the experts! Visit
>>>>> http://goo.gl/it488V for more information.
>>>>> ==
>>>>>
>>>>> Ing. Alessio Fabiani
>>>>>
>>>>> @alfa7691
>>>>> Founder/Technical Lead
>>>>>
>>>>>
>>>>> GeoSolutions S.A.S.
>>>>> Via di Montramito 3/A
>>>>> <https://maps.google.com/?q=Via+di+Montramito+3/A+55054+%C2%A0Massarosa&entry=gmail&source=g>
>>>>> 55054  Massarosa
>>>>> <https://maps.google.com/?q=Via+di+Montramito+3/A+55054+%C2%A0Massarosa&entry=gmail&source=g>
>>>>> (LU)
>>>>> Italy
>>>>> phone: +39 0584 962313 <+39%200584%20962313>
>>>>> fax:     +39 0584 1660272 <+39%200584%20166%200272>
>>>>> mob:   +39 331 6233686 <+39%20331%20623%203686>
>>>>>
>>>>> 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.
>>>>>
>>>>> ------------------------------------------------------------
>>>>> ------------------
>>>>> Check out the vibrant tech community on one of the world's most
>>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>>>> _______________________________________________
>>>>> Geoserver-devel mailing list
>>>>> [email protected]
>>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-devel
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Regards,
>>>>
>>>> Andrea Aime
>>>>
>>>> ==
>>>> 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
>>>> <https://maps.google.com/?q=Via+di+Montramito+3/A+55054+%C2%A0Massarosa&entry=gmail&source=g>
>>>> 55054  Massarosa
>>>> <https://maps.google.com/?q=Via+di+Montramito+3/A+55054+%C2%A0Massarosa&entry=gmail&source=g>
>>>> (LU)
>>>> phone: +39 0584 962313 <0584%20962313>
>>>> fax: +39 0584 1660272 <0584%20166%200272>
>>>> mob: +39  339 8844549 <339%20884%204549>
>>>>
>>>> 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.
>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Reply via email to