Tuesday, 31 July 2018

Change SDE Version in ArcGIS JavaScipt API depending on connected user


I am programming for an web editing application with ArcGIS API for JavaScript. I've published a version of ArcSDE with Feature Acces and I need to know how can I change in the web application from this version to another through the user that is connected to the application using the security manager of ArcGIS Server.


I've seen that exist a parameter gdbVersion and SetGDBVersion of featurelayer, but I don't know how to use. I need to see some example of this because the information in the documentation is not enough.


Can anyone help me? Any sample, please? Thanks



Answer



i definitely disagree with Sunil's comment above.



take a look at the following sample https://developers.arcgis.com/en/javascript/jssamples/widget_identitymanager_client_side.html


within the storeCredentials function you can see that the username of the person that signed in can be dug out using a statement like this


idObject.credentials[0].userId;
>>>"rick"

you would have to write your own logic to use information like this to determine how to set an appropriate corresponding SDE version on the featureLayer for editing.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...