kartoza / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
8 stars 17 forks source link

Updating layer metadata using geonode admin causes error #127

Open NyakudyaA opened 7 years ago

NyakudyaA commented 7 years ago

Problem

When a layer's metadata is edited using the geonode admin page it has mandatory fields like : SLD which prevent it from saving the metadata. If you put a fake url for the metadata it saves the record.

adi

After this change if you try to access the layer in geonode/layers/layer_name it gives an error because it now tries to look for the sld.

index

Solution

Disable mandatory fields when editing layers through geonode admin page.

gubuntu commented 7 years ago

@NyakudyaA pls test again and comment or close

NyakudyaA commented 7 years ago

@gubuntu Errors still exist and we need to disable all fields associated with geoserver

gubuntu commented 7 years ago

@NyakudyaA @lucernae I wonder if this affects metadata upload as well? If we upload a new metadata doc to replace one for a layer in QGIS server backend, is GeoNode rejecting it because of lack of mandatory geoserver fields?

@lucernae I'm labelling this Ready as it might be an issue for the GeoSAFE demo instance.

@NyakudyaA could you test this and other metadata issues while setting up the demo data?

gubuntu commented 7 years ago

related to #251 and #143

gubuntu commented 6 years ago

@lucernae is this affected by https://github.com/kartoza/geosafe/pull/378

lucernae commented 6 years ago

@gubuntu yes. On several notes.

  1. Editing metadata through Admin page is not covered. The admin page is tightly configured for GeoServer. We may be able configure the layout for QGIS Server only if we're able to override it. And yes, it rejects because it was mandatory field for GeoServer layers.
  2. Layer Upload Metadata now works. To update metadata, you can download ISO metadata first from the layer. Edit it, and reupload just the metadata on the same layer. Note that since InaSAFE only handles ISO metadata, we didn't cover any other type of metadata (if you download it, it won't have InaSAFE keywords, we don't know where to put it on other types).
  3. I put unittests and did some light testing on testing server. If you upload metadata which doesn't have inasafe keywords, the layer will be excluded from GeoSAFE InaSAFE layers. If you include the metadata again, it will be recognized again. Some mandatory field that is recognized by GeoNode, like layer title will also be consumed and change the actual title of the layer.
  4. Using Layer Upload Metadata now should not break the whole site. The metadata will not be duplicated, the base file will be safe, and the styles will still be there.

Let me know if you have some problem with it. There maybe some edge cases which I didn't think of.

gubuntu commented 6 years ago

I don't think the normal use case is to edit metadata via admin but rather via uploading or the UI so I'll close this. (open again if you disagree @NyakudyaA )

thanks for comments @lucernae

NyakudyaA commented 6 years ago

@gubuntu The recommended way of editing metadata is by using the UI which allows you to upload new metadata records but the backend also provides more options in terms of editing metadata.

Although it should not be high priority to fix this I suggest we need to fix this at some point so that users can have a seamless workflow.

The only two fields which are required are the store and style. The easiest way would be just to disable these two since QGIS backend does not use them or alternatively just fill them in with dummy values.

gubuntu commented 6 years ago

OK let's leave this in the backlog

lucernae commented 6 years ago

Yes, I agree with @NyakudyaA we should be able to disable/hide Geoserver's specific field such as store and style. We can probably override the admin page.