associate a saved project with a different site
It would be great to be able to export, replace references to an old site name with a new site name, then import a project's JSON into the document store.
Thanks,
Lee
-
You can download a project's definition as json from the Manager. From that json, get the document tag, rewrite it as you like, and use it as input to https://SERVER/Geocortex/Essentials/GeoWeb54/REST/documents/writeDocument (inspect the requests being made by your browser when you store a project). You may also need to check if the mapservice ID's are the same as your old site.
I did this once when all our users were migrated to a different identity store and lost access to their projects. There were some hundreds of projects, so instead of downloading them from the Manager one by one, we used some tool to access the Elastic Search database directly. I can't remember the name, but if you want I can try to find it.0 -
Hello Berand,
Could you explain how you use the writeDocument and the readDocument HTTP request to have access to your projets saved in Geocortex essentiel application ? With my application, I would like to pull the json file of specific projet, modified the json and push the json projet file to the application.
Thanks,0 -
The key is to watch network traffic while saving or opening a project from the user interface. In the browser, press F12, and open the Network tab.
I can't remember what I did exactly, but it was something like this:
In a workflow, you could start by using a WebRequest to load an existing project (e.g. GET https://www.example.com/Geocortex/Essentials/Default/REST/documents/readDocument?id=PROJECTID&format=json&f=json&token=YOURTOKEN
You can get the token from the Get Request Info activity. You also need to know the project ID in advance, or make a GET request to https://www.example.com/Geocortex/Essentials/Default/REST/documents/searchDocuments?documentQuery= and present the results to the user.
This will return the project in JSON format, so at this point, you can modify the project.
Save the modified project by making a POST request to https://www.example.com/Geocortex/Essentials/Default/REST/documents/writeDocument, with ContentType application/x-www-form-urlencoded, and a body containing content:(the modified json), f:json, token:YOURTOKEN0 -
Was the tool Elasticsearch?
0 -
Erwin,
I don't remember which tool I was referring to in my first answer.
But last year I had to do something similar (i.e. export several 100s of projects to be moved to a different site). I first tried Kaizen, this worked fine for a small database, but failed when there were like 10,000 records (one project may consist of several 'chunks').
What worked for me eventually was ES2CSV, which is a Python module. Install like this (I used version 2.7), on the machine that Geocortex is running on:
C:\Python27\Scripts\pip install es2csvThen use this for exporting:
C:\Python27\Scripts\es2csv.exe0 -
Thanks! Can it also be used to import it in a new database?
0 -
@Erwin van der Bij?
Not that I know. I used a (startup) workflow with some WebRequests to do that. Users can import projects with their own credentials, and the project owner will be set to the correct account.
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
7 kommentarer