<div dir="ltr">Taking a look into the logs, the first JSON is correct. The issue is on the reloading of the base_contactrole dependency.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>==<br>GeoServer Professional Services from the experts! Visit<br><a href="http://goo.gl/NWWaa2" style="color:rgb(17,85,204)" target="_blank">http://goo.gl/NWWaa2</a> for more information.<br>==<br></div><div><br></div><div>Ing. Alessio Fabiani</div><div>@alfa7691</div><div>Founder/Technical Lead</div><div><br></div><div>GeoSolutions S.A.S.</div><div>Via Poggio alle Viti 1187</div><div>55054 Massarosa (LU)</div><div>Italy</div><div>phone: +39 0584 962313</div><div>fax: +39 0584 1660272</div><div>mob: +39 331 6233686</div><div><br></div><div><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a></div><div><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a></div><div><br></div><div>-------------------------------------------------------</div><div><br></div><div><p><span lang="IT"><font size="1"><b>AVVERTENZE AI SENSI DEL D.Lgs. 196/2003</b></font></span></p><p><span lang="IT"><font size="1">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.</font></span></p><p><span lang="IT"><font size="1"> </font></span></p><p><font size="1">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.</font></p></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Fri, Jan 22, 2016 at 5:26 PM, Alessio Fabiani <span dir="ltr"><<a href="mailto:alessio.fabiani@geo-solutions.it" target="_blank">alessio.fabiani@geo-solutions.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear list,<div>working on the GeoNode Backup and Restore task I'm struggling with an issue while trying to deserialize data.</div><div><br></div><div>Basically what I'm trying to do is dump the GeoNode fixtures as JSON files and trying to load them later on an empty (prepared) GeoNode DB.</div><div><br></div><div>Now ... by playing a bit with the json outputs and load order I am able to restore almost all the fixtures, but I have an issue with the Layers, inherited from ResourceBases.</div><div><br></div><div>I am able to restore succesfully the ResourceBases but whenever I try to deserialize a Layer I'm getting and error with the primary key.</div><div><br></div><div>Using the default JSON like this:</div><div><br></div><div><div>[</div><div>{</div><div> "pk": 1, </div><div> "model": "layers.layer", </div><div> "fields": {</div><div> "styles": [</div><div> 1</div><div> ], </div><div> "store": "datastore", </div><div> "name": "san_andres_y_providencia_administrative", </div><div> "service": null, </div><div> "charset": "UTF-8", </div><div> "title_en": "San Andres Y Providencia Administrative", </div><div> "abstract_en": "No abstract provided", </div><div> "regions": [], </div><div> "typename": "geonode:san_andres_y_providencia_administrative", </div><div> "default_style": null, </div><div> "purpose_en": null, </div><div> "workspace": "geonode", </div><div> "upload_session": 9, </div><div> "supplemental_information_en": "No information provided", </div><div> "data_quality_statement_en": null, </div><div> "storeType": "dataStore", </div><div> "distribution_description_en": null, </div><div> "constraints_other_en": null</div><div> }</div><div>}</div><div>]</div></div><div><br></div><div>I get an error message like: null violates constraint for "resource_id"</div><div><br></div><div>If I try to modify the JSON like this:</div><div><br></div><div><div>[</div><div>{</div><div> "<b>resourcebase_ptr_id</b>": 1, </div><div> "model": "layers.layer", </div><div> "fields": {</div><div> "styles": [</div><div> 1</div><div> ], </div><div> "store": "datastore", </div><div> "name": "san_andres_y_providencia_administrative", </div><div> "service": null, </div><div> "charset": "UTF-8", </div><div> "title_en": "San Andres Y Providencia Administrative", </div><div> "abstract_en": "No abstract provided", </div><div> "regions": [], </div><div> "typename": "geonode:san_andres_y_providencia_administrative", </div><div> "default_style": null, </div><div> "purpose_en": null, </div><div> "workspace": "geonode", </div><div> "upload_session": 9, </div><div> "supplemental_information_en": "No information provided", </div><div> "data_quality_statement_en": null, </div><div> "storeType": "dataStore", </div><div> "distribution_description_en": null, </div><div> "constraints_other_en": null</div><div> }</div><div>}</div><div>]</div></div><div><br></div><div>I get the following error:</div><div><br></div><div>ResourceBase matching query does not exist.<br></div><div><br></div><div>Any idea/help ?</div><div><br clear="all"><div><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>==<br>GeoServer Professional Services from the experts! Visit<br><a href="http://goo.gl/NWWaa2" style="color:rgb(17,85,204)" target="_blank">http://goo.gl/NWWaa2</a> for more information.<br>==<br></div><div><br></div><div>Ing. Alessio Fabiani</div><div>@alfa7691</div><div>Founder/Technical Lead</div><div><br></div><div>GeoSolutions S.A.S.</div><div>Via Poggio alle Viti 1187</div><div>55054 Massarosa (LU)</div><div>Italy</div><div>phone: <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313</a></div><div>fax: <a href="tel:%2B39%200584%201660272" value="+3905841660272" target="_blank">+39 0584 1660272</a></div><div>mob: <a href="tel:%2B39%20%C2%A0331%206233686" value="+393316233686" target="_blank">+39 331 6233686</a></div><div><br></div><div><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a></div><div><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a></div><div><br></div><div>-------------------------------------------------------</div><div><br></div><div><p><span lang="IT"><font size="1"><b>AVVERTENZE AI SENSI DEL D.Lgs. 196/2003</b></font></span></p><p><span lang="IT"><font size="1">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.</font></span></p><p><span lang="IT"><font size="1"> </font></span></p><p><font size="1">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.</font></p></div></div></div></div></div></div></div></div>
</div></div>
</blockquote></div><br></div>