Track editors and edits using JS API 3.9

6562
17
Jump to solution
06-20-2014 08:08 AM
AlexGole1
New Contributor II
Hi all,

I am trying to get started on building a web app that would allow our users to verify who, what, and when a layer was last edited last.


I am wondering if any of you have tips, examples, or other to get me started?

Below is a picture of (roughly) what I intend to create.

Thank you,
Alex
[ATTACH=CONFIG]34774[/ATTACH]
0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor
Archiving maintains the history of the geometry and all the fields.  Since editor tracking just records information in fields, the history is maintained as well.  Take a look at the screen shots below.  You can see the 'Last Edited User' and 'Last Edited Date' fields are different values.  This will show what was edited, who edited the feature, and when the feature was edited.

[ATTACH=CONFIG]34848[/ATTACH][ATTACH=CONFIG]34849[/ATTACH]

View solution in original post

0 Kudos
17 Replies
JakeSkinner
Esri Esteemed Contributor
Hi Alex,

You can enable editor tracking:

http://resources.arcgis.com/en/help/main/10.2/index.html#//01540000048s000000

You can also enable this with hosted feature services:

[ATTACH=CONFIG]34777[/ATTACH]

http://doc.arcgis.com/en/arcgis-online/share-maps/manage-services.htm
0 Kudos
AlexGole1
New Contributor II
Hi Alex,

You can enable editor tracking:

http://resources.arcgis.com/en/help/main/10.2/index.html#//01540000048s000000

You can also enable this with hosted feature services:

[ATTACH=CONFIG]34777[/ATTACH]

http://doc.arcgis.com/en/arcgis-online/share-maps/manage-services.htm


Thanks Jake!

I have already found track edits function in ArcGIS and already published a Feature Service using this. Since I do not have AGO  (we use ArcGIS Server 10.2). I also enabled ownership based Feature layer[ATTACH=CONFIG]34778[/ATTACH]

my question: how do I use this functionality using the ArcGIS API 3.9?  I just saw a little piece of code that might be helpful but it does not really do what I intend. I want something similar to the image i sent earlier.

getEditSummary(feature,options?)


found here: https://developers.arcgis.com/javascript/jsapi/featurelayer.html

Thanks,

Alex
0 Kudos
JakeSkinner
Esri Esteemed Contributor
The original screenshot you sent is small, so it's tough to see what's going on.  It looks like edits are being made, and then they are labeled with the editor.  Is that correct?  Is this what you are looking to accomplish?
0 Kudos
AlexGole1
New Contributor II
The original screenshot you sent is small, so it's tough to see what's going on.  It looks like edits are being made, and then they are labeled with the editor.  Is that correct?  Is this what you are looking to accomplish?


Sorry that the only screen shot I found online, but yes that is exactly what I am trying to accomplish. I want to "graphically know who edited/created/updated what last.
0 Kudos
JonathanUihlein
Esri Regular Contributor
I think getEditSummary() only returns the very last operation performed.

https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#geteditsummary

Just to be clear: you are seeking a method to expose the full history of edits?
0 Kudos
AlexGole1
New Contributor II
I think getEditSummary() only returns the very last operation performed.

https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#geteditsummary

Just to be clear: you are seeking a method to expose the full history of edits?


Jonathan,
Yes. We are using feature layers in our web apps that have been updated by various teams within the same agency. Let's say within one department you three teams A, B, C. I want to see which one of these team edited what layer and when. So yes, I want the full edit history. I also would like users to be able to edit online accordingly to what team they belong too. That is my goal.
Thank you,
Alex
0 Kudos
JakeSkinner
Esri Esteemed Contributor
If you are working with an enterprise geodatabase you can accomplish this through archiving.  You can publish the Historical Archive feature class as a service.  You will then have access to all of the edit history when you query (i.e. identify) the layer in your application.
0 Kudos
AlexGole1
New Contributor II
If you are working with an enterprise geodatabase you can accomplish this through archiving.  You can publish the Historical Archive feature class as a service.  You will then have access to all of the edit history when you query (i.e. identify) the layer in your application.


First of all thank you for your answer and help! I don't really have a good understanding of the difference between Archiving and Tracking edits but it seems like Archiving does not keep track of who made the edits. Am I correct? I need to answer the three questions "Who? What? and When?". seems like archiving advantage is that it gives you the entire FC history. Is there a way to have archiving tracking the user too?
Thanks
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Archiving maintains the history of the geometry and all the fields.  Since editor tracking just records information in fields, the history is maintained as well.  Take a look at the screen shots below.  You can see the 'Last Edited User' and 'Last Edited Date' fields are different values.  This will show what was edited, who edited the feature, and when the feature was edited.

[ATTACH=CONFIG]34848[/ATTACH][ATTACH=CONFIG]34849[/ATTACH]
0 Kudos