POST
|
Well, instead of Basic mode I've tried Digest, NTLM and Negotiate. Same empty sitemap. On to other attempts.
... View more
07-31-2017
07:04 AM
|
0
|
0
|
441
|
POST
|
We recently switched an ESRI webserver to use the https protocol and (unhappily!) discovered that the https://MyEsriUrl/arcgis/rest/services?f=sitemap command did not return data unless the active directory user had the GIS admin privileges. So, my intended solution to this is to create a C# webservice to receive a parameter of https://MyEsriUrl/arcgis/rest/services?f=sitemap, which will connect to the ESRI webserver using an active directory service account that has the necessary GIS privileges. It will receive the sitemap info and return it to the user. (See https://community.esri.com/thread/198410-httpsmyesriurlarcgisrestservicesfsitemap-doesnt-work#comment-701985 ) for more details on the original problem.) There are a bazillion ways to pass security credentials and I just want to use the right way the first time, or at least find it while I still have hair that hasn't been pulled out. Here's some sample code: public XmlDocument GetSiteMap (string url) { Uri uri = new Uri(url); string user = "domain\\user"; string pwd = "thepassword"; HttpWebRequest request = WebRequest.Create(uri) as HttpWebRequest; // some magic happens here... using(HttpWebResponse response = request.GetResponse() as HttpWebResponse) { // I do my stuff here, no problem at this point. } } Here's one approach I used to supply the magic needed: // some magic happens here... request.PreAuthenticate = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3; CredentialCache credentialCache = new CredentialCache(); credentialCache.Add(uri, "Basic", new NetworkCredential(user, pwd)); request.Credentials = credentialCache; No luck. If I log on to the computer using the user/pwd and make the sitemap call in the browser I get back sitemap data. But using the same credentials as above I get back an empty sitemap.
... View more
07-31-2017
06:02 AM
|
0
|
2
|
698
|
POST
|
I've rewritten my code to make multiple, recursive calls to the server via the ?f=json and it's slow as all get out. Yuck! So, I'm going to create a service acct with GIS admin privs and create a web service to wrap the call to the ?f=sitemap option. That way, the web service will ask as an admin and pass the data I need back much faster. For gis websites that aren't "ours" (so we don't have admin access), we'll use the new code I've written.
... View more
07-21-2017
06:21 AM
|
0
|
0
|
529
|
POST
|
arcgis server - esri rest service ?f=sitemap returns no services - Geographic Information Systems Stack Exchange covers this in more detail. Apparently, this is intended behavior. Can't understand why, but it is what it is.
... View more
07-20-2017
06:56 AM
|
0
|
0
|
529
|
POST
|
Item #3 above was a browser caching issue. So at least I'm getting consistent results. Any ideas how to get ?f=sitemap to work for someone who isn't a site admin?
... View more
07-20-2017
05:32 AM
|
0
|
1
|
529
|
POST
|
I have some code that queries the esri webserver for a list of services. I start off with: https://MyEsriUrl/arcgis/rest/services?f=sitemap That code worked for years. We recently attached a portal to our esri webserver. We're now running v10.5 of both. Now, the esri admin can issue this command in the browser and it still works, but if I issue it I get an empty list back. I thought it might be a permissions issue except for three facts: (1) If I go to https://MyEsriUrl/arcgis/rest/services I can see everything I ought to see. (2) I've found out that I can now use https://MyEsriUrl/arcgis/rest/services?f=json and that also works correctly. (3) Esri admin added me to the esri admin role and I still can't see anything with ?f=sitemap. Obviously, I can rewrite the code to work, but that app is scheduled to be replaced and I would rather spend time working on the replacement app... Any ideas on how to get ?f=sitemap to work properly?
... View more
07-19-2017
06:40 AM
|
0
|
3
|
666
|
POST
|
Did you ever find a solution? I ask because I have a similar problem. Documentation is sparse and, so far, not useful.
... View more
07-18-2017
05:20 AM
|
0
|
0
|
351
|
POST
|
Sorry, I missed that. (And you were very clear about it , too!) I've seen some code in the widgets about "editing related tables" but each of our gis tables are stand-alone so I've never figured out exactly what that code does. You could certainly create a custom service in C# (or whatever) that would interact with whatever database you're using. Javascript, Dojo and Dijit would certainly work to build a data entry screen with and could be used to call your services. Sorry not to be as much help as I thought I was being!
... View more
07-07-2017
12:27 PM
|
0
|
1
|
615
|
POST
|
I've done a good deal more work on the Edit widget since my last reply. I created a java script class to act as a CustomRecordHandler. My intent was to keep as many changes out of the widget.js file as I possibly could so it would be easier to upgrade to newer versions of the Edit widget. So, I instantiated CustomRecordHandler in the widget.js variable list. (Naturally, that meant it had to be mentioned in the define/function list for the widget.js module.) I created a call to the _customRecordHandler object in the widget.js startup, onBeforeApplyEdits, _worksAfterCreate and _onEditorPopupShow methods. That way, I only had a few lines of code to replicate in order to move to a new version of the Edit widget. A lot of the info you may need is only available in the widget.js context so be sure to pass in what you need to your various methods. The onBeforeApplyEdits was the only really tricky event to handle because it is NOT called asynchronously and some of the ESRI code I wanted to execute at that point in time REQUIRED an asynchronous call. In order to get around that problem I created a custom c# web service that could be called synchronously and didn't return results until it was done. I don't like that particular kluge, but the only fix would be to alter the call to onBeforeApplyEdits to be an asynchronous one -- and doing that with minimized code was more than I was willing to attempt! Tasks I charged the events to achieve were: onStartup - compare the list of layers in the variable holding the Edit widget config file with the list of layers actually on the map. If the layers actually on the map include an editable layer (which you can determine by checking the layer's capability property) that isn't in the config file-based object, I call I routine to add that layer to the config file-based object. (The format of the data to put into the config file object is pretty intuitive.) I also tell the map to call the same method if someone later adds a new layer to the map using the layer-add-result . (I have to bind the method with the widget's this context before I hook it up to the layer-add-result call, or it won't have access to the info that method will need.) That way, it doesn't matter whether the user adds an editable layer before or after the Edit widget is invoked. PS - the map has a graphics layer that's there for some purpose and you'll want to ignore it. I found that checking for an undefined layer capability property worked for that purpose. _worksAfterCreate - add the custom fields to the editor object. I was adding buttons to do simplify common tasks for our users. I created these items but hid them because they shouldn't be used for all layers, just some of them. _onEditorPopupShow - I changed the display settings for the items I created in _worksAfterCreate if they should be used for the layer being altered. I can't definitively state that splitting up the work between the _worksAfterCreate and the _onEditorPopupShow events was necessary, but it seemed the right thing to do at the time. onBeforeApplyEdits - pass the widget context, plus the results of a call to this.getOriginalAttributesBeingEdited(), plus the edits parameter the method receives to my custom routine. This is the workhorse for the code that I added. I was able to set default values that had to be determined at run time instead of design time. As I mentioned before, you'll have to avoid or hide asynchronous calls at this point in time, the ESRI code will just ignore and proceed without waiting. I made one other mod to the Edit widget, but in the FilterEditor.js file. I added a field where a user could type in a latitude, longitude (or other coordinate method) into it and a plot button in the _createFilterTool method. The Edit widget, out of the box, will let the user select a template from the list of editable layers and click on the map to create the object. In our case, sometimes the users are entering data where they already know the coordinates the point is supposed to be created at, so making them navigate to that location on the map is time-consuming and unnecessary. If the user has selected a template and entered a coordinate, pressing the plot button will call the same CustomRecordHandler object. It calls a method that receives the FilterEditor.js this object, the coordinate value that the user entered, the this._editWidget.editor.templatePicker.getSelected() results, and an indicator that an insert is happening. The customRecordHandler object zooms to the location on the map and then calls the chosen template's featureLayer.applyEdits method, supplying a new graphic at that coordinate in an array in the adds parameter slot, plus some callback functions to resolve or reject the promise results. Hope this helps some folks customize the editor object to their heart's content!
... View more
07-07-2017
05:20 AM
|
0
|
0
|
427
|
POST
|
To directly answer the question you asked: "No, unless you already know javascript, dojo, dijit, and the ESRI javascript api very well. If you already know those items well, then yes, if you also have an editable service set up in esri web server and portal." HOWEVER, such a task is completely unnecessary (except for the part about "an editable service set up in esri web server and portal"). Create a web appbuilder application and add the editable service to the map. Then add the Edit widget and configure it to allow your users to edit that service. Piece of cake and zero programming required!
... View more
07-06-2017
01:17 PM
|
1
|
1
|
615
|
POST
|
As a new dojo/dijit UI coder, it's a bit disorienting because the html files in the widget and the html output I can see in the page debugger are extremely different. I found that adding id attributes to the elements defined in the html files really helped me figure out what run time generated html went with what.
... View more
06-28-2017
06:42 AM
|
0
|
0
|
530
|
POST
|
I worked this issue on and off over the last 2 weeks. It can be done. I'm untrained on dojo/dijit UI classes so it's been slow going. I was able to get the setting page to display and function. Didn't get around to making the changes to disable writing back to the config file because I found a better solution. I found out that the same query capability at run time was available built into the map. There is a little Up-arrow on a tab at the bottom of the map. If you click on it you see tabs with the different feature layers on them. Each tab has an Options menu with a Filter option. Once I found this functionality I stopped work on this issue. As for getting the setting page to show up, the setting.js and setting.html files in a widget do not include the Ok, Cancel or Close window buttons. Nor do they include the code to change the widget icon. You'll have to code your own container to load the setting page into. Subtle differences between my container and the container they use caused the display of the fields to be horribly wrong. I had to change a few style settings at run time to get it to work. Since your container may be different from my own, comparing style settings of the page you invoke with your code and the same page invoked with their code will identify the differences. The key to starting up the page after coding a container for it was finding the lines of code necessary to do so. A call to widgetManager.tryLoadWidgetConfig(setting) asynchronously starts off the load process. When it returns with a result, you'll need to lang.hitch a function to invoke widgetManager.loadWidgetSettingPage(setting) asynchronously. When that returns, place it in your container and run the setting page object's startup() method. As for the setting object so casually passed around above, I went into the debugger and checked out what was in it when the setting page was invoked in the web appbuilder client. It turns out that all the necessary values to construct a setting object of my own were available as this.* values in the widget.js file. The setting page appears to write to the config file on startup, which was a bit surprising. I suspect it has to do with setting up an initial default page if one isn't there. As I stopped work on this task about the time I noticed that, I can't add more detail. As for node.js dependencies, haven't found any. All the code I've had to call to make this happen has been automatically deployed to each application. I hope this will help others who find themselves wanting to do something similar.
... View more
06-28-2017
06:35 AM
|
1
|
1
|
530
|
POST
|
Should not be a problem because the users won't be writing back to the file system. The json file gets loaded into memory and the widget uses the values in memory to make its decision. I'll be modifying the back-end to disable any attempts to write the changes back to the file system when invoked from the runtime.
... View more
06-14-2017
02:37 PM
|
0
|
4
|
530
|
Title | Kudos | Posted |
---|---|---|
1 | 03-03-2017 10:52 AM | |
1 | 04-04-2017 07:55 AM | |
1 | 04-04-2017 06:41 AM | |
1 | 04-24-2017 04:55 AM | |
1 | 06-28-2017 06:35 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|