|
POST
|
I just checked to see if you could name it to a space, but it seems any whitespace by itself is not allowed. The only other thing I can think of is to rename it to something less noticable like the pipe '|' or an underscore or a dash. You might want to experiment with republishing the map you used to publish the service on ArcGIS Server. Name all of your layers and your data frame something you can live with. I checked my basemap service I published that has many layers and my legend has the data frame name at the top, not the name of the service. So maybe check that data frame name.
... View more
06-05-2015
10:45 AM
|
0
|
3
|
1815
|
|
POST
|
I don't know if you can get around having the service name show up in your legend. Maybe you could rename the service making the new name empty?
... View more
06-05-2015
10:28 AM
|
0
|
5
|
1815
|
|
POST
|
The way I implemented it was one field at a time. Edit the DynamicValue table, save, stop and start the AA and create a new feature to see if it worked and if it didn't try to figure out why. Posting here is a great way to figure things out as well.
... View more
06-05-2015
09:45 AM
|
1
|
0
|
2129
|
|
POST
|
Have you tried right clicking on those layers and choosing Rename Layer in the Web Map? I think that would push those layer names out to the Web App.
... View more
06-05-2015
09:15 AM
|
1
|
1
|
1815
|
|
POST
|
Nina, As has been said, yes you can use the Attribute Assistant add-in without using any of the local government templates or the Local Government Information Model. The only thing about the templates and the LGIM is they are already configured to work with the add-in. I agree with Sephe Fox that this location is the best place for your question, but only because these folks would be better able to answer your question. I think anyone doing a lot of editing and data production could greatly benefit from learning how to configure the Attribute Assistant. It is a huge time saver. If I were to utilize it without the use of a template I would set it up this way Download one of the templates from the Local Government solutions site. I think the Address Data Management template is as good as any. Unzip the contents of that folder to a folder on your hard drive. I would then copy the DynamicValue table from the LocalGovernment file geodatabase in the MapsandGeodatabase folder to your SDE instance. This way the table is set up properly with the correct field names and types as well as the domains for the fields. You might want to do the same with the GenerateID table. The trouble with the GenerateID table is it can't be versioned. The GenerateID table contains records that keep track of ID numbers for new features. It can't be versioned or you would end up with duplicate IDs if there are multiple editors. Familiarize yourself with the DynamicValue table and the toolbar. You can then start setting up the methods on the fields you want to be automated. Here is a reference to the methods with samples for each method. I have found that when you enter a table name in the Table Name field it needs to be the actual feature class name not the alias or the layer name in the TOC. Same goes for the field names in the Field Name field. (wow, the word field showed up a lot in that last sentence) I found it causes a lot less pain if I just go to the layer properties and copy the feature class name from the source tab and the field name from the fields tab. That way I am less likely to have the method fail because of typos. You can actually open up the map template and open the DynamicValue table to see all of the different ways the Local Government team has set things up. This can help you when you get stuck on something. Their DynamicValue table has records for the entire Local Government Information Model. You may notice that they have * entries in the Table Name field - they act as a wildcard so that any feature class with that field name will have that method applied to it. Fields like LastEditor or LastUpdate are prevalent throughout the LGIM so these are taken care of with one entry in the DynamicValue table. One other point of advice, as you are figuring out your methods you need to save your edits and stop and start the Attribute Assistant after you make changes to the DynamicValue table. The log file is also handy to help you figure out why something isn't working. There is a button on the AA toolbar that tells you where the log file is located. The Attribute Assistant has saved me a lot of time in manual field entry. I think it's the best thing to be developed by Esri in a long time. I blogged about setting it up here. That entry is a bit dated, but still useful. Thanks, Jeff
... View more
06-05-2015
08:56 AM
|
4
|
0
|
2129
|
|
POST
|
You can add python.exe to your executables path so you don't have to enter the path to python every time. See how here.
... View more
06-04-2015
03:28 PM
|
0
|
0
|
4293
|
|
POST
|
My apologies. I built a model that stopped and started services while some updates were made. It turns out the tools in the model that stopped and started the services were actually python script tools. I found them online somewhere, I can't remember where. Here's the code I have with my server info taken out. # Demonstrates how to stop or start all services in a folder
# For Http calls
import httplib, urllib, json
# For system tools
import sys
# Defines the entry point into the script
def main(argv=None):
# Print some info
print
print "This tool is a sample script that stops or starts all services in a folder."
print
# Ask for admin/publisher user name and password
username = '' #put your username here or get it from a parameter
password = ''
# Ask for server name
serverName = '' #your server name
serverPort = #your port integer type
folder = '' #folder that contains the service or services
stopOrStart = 'STOP'
# Check to make sure stop/start parameter is a valid value
if str.upper(stopOrStart) != "START" and str.upper(stopOrStart) != "STOP":
print "Invalid STOP/START parameter entered"
return
# Get a token
token = getToken(username, password, serverName, serverPort)
if token == "":
print "Could not generate a token with the username and password provided."
return
# Construct URL to read folder
if str.upper(folder) == "ROOT":
folder = ""
else:
folder += "/"
folderURL = "/arcgis/admin/services/" + folder
# This request only needs the token and the response formatting parameter
params = urllib.urlencode({'token': token, 'f': 'json'})
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
# Connect to URL and post parameters
httpConn = httplib.HTTPConnection(serverName, serverPort)
httpConn.request("POST", folderURL, params, headers)
# Read response
response = httpConn.getresponse()
if (response.status != 200):
httpConn.close()
print "Could not read folder information."
return
else:
data = response.read()
# Check that data returned is not an error object
if not assertJsonSuccess(data):
print "Error when reading folder information. " + str(data)
else:
print "Processed folder information successfully. Now processing services..."
# Deserialize response into Python object
dataObj = json.loads(data)
httpConn.close()
# Loop through each service in the folder and stop or start it
for item in dataObj['services']:
fullSvcName = item['serviceName'] + "." + item['type']
# Construct URL to stop or start service, then make the request
stopOrStartURL = "/arcgis/admin/services/" + folder + fullSvcName + "/" + stopOrStart
httpConn.request("POST", stopOrStartURL, params, headers)
# Read stop or start response
stopStartResponse = httpConn.getresponse()
if (stopStartResponse.status != 200):
httpConn.close()
print "Error while executing stop or start. Please check the URL and try again."
return
else:
stopStartData = stopStartResponse.read()
# Check that data returned is not an error object
if not assertJsonSuccess(stopStartData):
if str.upper(stopOrStart) == "START":
print "Error returned when starting service " + fullSvcName + "."
else:
print "Error returned when stopping service " + fullSvcName + "."
print str(stopStartData)
else:
print "Service " + fullSvcName + " processed successfully."
httpConn.close()
arcpy.SetParameterAsText(1, 'true')
return
# A function to generate a token given username, password and the adminURL.
def getToken(username, password, serverName, serverPort):
# Token URL is typically http://server[:port]/arcgis/admin/generateToken
tokenURL = "/arcgis/admin/generateToken"
params = urllib.urlencode({'username': username, 'password': password, 'client': 'requestip', 'f': 'json'})
headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
# Connect to URL and post parameters
httpConn = httplib.HTTPConnection(serverName, serverPort)
httpConn.request("POST", tokenURL, params, headers)
# Read response
response = httpConn.getresponse()
if (response.status != 200):
httpConn.close()
print "Error while fetching tokens from admin URL. Please check the URL and try again."
return
else:
data = response.read()
httpConn.close()
# Check that data returned is not an error object
if not assertJsonSuccess(data):
return
# Extract the token from it
token = json.loads(data)
return token['token']
# A function that checks that the input JSON object
# is not an error object.
def assertJsonSuccess(data):
obj = json.loads(data)
if 'status' in obj and obj['status'] == "error":
print "Error: JSON object returns an error. " + str(obj)
return False
else:
return True
# Script start
if arcpy.GetParameterAsText(0):
main()
else:
arcpy.AddMessage("Previous tool exited on error")
... View more
06-04-2015
03:24 PM
|
1
|
1
|
4293
|
|
POST
|
A quick way to learn how to do something with python is to put together a simple model in model builder and export that model to a python script and see what the command is and what the arguments are.
... View more
06-04-2015
03:10 PM
|
0
|
3
|
4293
|
|
POST
|
Keep in mind this doesn't round, it truncates. So 259,900 would show up as 259K instead of 260K.
... View more
06-04-2015
02:38 PM
|
0
|
0
|
3317
|
|
POST
|
If they are integers you can use this to calculate the new text field using the python parser str(value / 1000) + 'K' If they are floats str(int(value) / 1000) + 'K' Replace 'value' in the above script with '!your_field_name!
... View more
06-04-2015
02:34 PM
|
1
|
1
|
3317
|
|
POST
|
You can do it both ways. Dynamic labeling with scripts usually comes with a performance hit since it has to do the job with every feature with every pan, zoom etc. If you create a field and calculate it, you would only run the script once and label on that field.
... View more
06-04-2015
02:27 PM
|
1
|
0
|
3317
|
|
POST
|
These are the default context options in the map area: If you are looking for information regarding features - you would use the identify tool for that. If you want to be able to move/modify features, you need to be editing the features to allow those context options and you need to use the edit tool.
... View more
06-04-2015
02:20 PM
|
0
|
0
|
2528
|
|
POST
|
What context menus are you looking for? Can you post a screen shot?
... View more
06-04-2015
02:15 PM
|
1
|
3
|
2528
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2011 12:55 PM | |
| 1 | 01-13-2021 11:29 AM | |
| 2 | 06-05-2024 07:29 AM | |
| 1 | 04-26-2024 11:42 AM | |
| 1 | 02-12-2024 07:49 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-25-2026
02:36 PM
|