Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find a feature class inside a schema/owner #18

Open
dncpax opened this issue Dec 7, 2018 · 3 comments
Open

can't find a feature class inside a schema/owner #18

dncpax opened this issue Dec 7, 2018 · 3 comments

Comments

@dncpax
Copy link

dncpax commented Dec 7, 2018

If you have 2 feature classes with the same name but in different schemas or different owners, both are found.

For example:
user1.fcRivers
user2.fcRivers

Code:
# find services that have the parcels layer from this sde database
ws = r'\arcserver2\SDE_Connections\MN_GIS_LIS.sde'
feature_classes = ['user1.fcRivers']
matching = server.find_services_containing(ws, feature_classes)

This will match all services that use either feature classe, from user1 and user2.

It would be logical and useful to consider them different things.

@dncpax
Copy link
Author

dncpax commented Dec 7, 2018

I can see that this may not be possible because of rest esri api limitations. Specifically, the service manifest strips the schema/owner from the feature class name, so this is not available:
http://localhost:6080/arcgis/admin/services/Parks/Landmarks.MapServer/iteminfo/manifest/manifest.json
This returns all layers with only name, no schema/owner...

@dncpax dncpax closed this as completed Dec 7, 2018
@CalebM1987
Copy link
Contributor

Thanks for posting. This actually may be possible, as each database connection referenced by the service does have a VERSION in the connection string. I would need to test, but just looking at a manifest.json for one of our services:

{
    "databases": [{
        "byReference": true,
        "onServerWorkspaceFactoryProgID": "esriDataSourcesGDB.SdeWorkspaceFactory.1",
        "onServerConnectionString": "SERVER=<SQL-SERVER-NAME>;INSTANCE=sde:sqlserver:<SQL-SERVER-NAME>;DBCLIENT=sqlserver;DB_CONNECTION_PROPERTIES=<SQL-SERVER-NAME>;DATABASE=Carver;VERSION=dbo.DEFAULT;AUTHENTICATION_MODE=OSA",
        "onPremiseConnectionString": "SERVER=<SQL-SERVER-NAME>;INSTANCE=sde:sqlserver:<SQL-SERVER-NAME>;DBCLIENT=sqlserver;DB_CONNECTION_PROPERTIES=<SQL-SERVER-NAME>;DATABASE=Carver;VERSION=dbo.DEFAULT;AUTHENTICATION_MODE=OSA",
        "onServerName": "dbo.DEFAULT (<SQL-SERVER-NAME>)",
        "onPremisePath": "",
        "datasets": [{
            "onServerName": "Roads"
        }, {
            "onServerName": "Parcels"
        }, {
            "onServerName": "Street_Lights"
        }, {
            "onServerName": "Parks"
        }, {
            "onServerName": "Zoning"
        }]
    }],
    "resources": [{
        "onPremisePath": "\\\\<SERVER>\\WebGIS\\CARV\\CARV_Webmap_MS.mxd",
        "clientName": "",
        "serverPath": "\\\\<SERVER>\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\CARV\\CARV_Webmap_MS.MapServer\\extracted\\v101\\CARV_Webmap_MS.msd"
    }]
}

You can see in the connection strings above, that it is referencing the default ;VERSION=dbo.DEFAULT;...Perhaps I could add an optional parameter where the user could specify a version, and if one is specified, we could probably filter the services by that version.

One disclaimer, all of our databsases use SQL Server, and since the link you provided was pointed to your localhost I could not examine the manifest.json and different types of databases will use different connection strings. But if they have a VERSION listed somewhere in it like what I showed above, I think it is probably doable.

@dncpax
Copy link
Author

dncpax commented Dec 10, 2018

Hi @CalebM1987.

I think the version is not the solution. The issue I refer to is about 2 users having an FC with the same name, not in different versions.
Imagine when there are no versions: the issue still occurs.

Since the the manifest strips the owner of the feature class I don't see any way to get this info.
I thought about the user in the connection string, but that won't work when you login with a different user with read privileges...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants