Esri / solution.js

TypeScript wrappers running in Node.js and modern browsers for transferring ArcGIS Online items from one organization to another.
https://esri.github.io/solution.js/
Apache License 2.0
39 stars 12 forks source link

Pull all properties from portal/self under "organization" and logged in user under "user" in the template replacement dictionary #138

Closed chris-fox closed 4 years ago

chris-fox commented 4 years ago

In the template replacement dictionary we should reserve the "organization" object for all the properties returned from the target portal/self call. https://developers.arcgis.com/rest/users-groups-and-items/portal-self.htm

This will allow us to support any property defined by the portal during template replacement. For example today we have something like:

{
    "organization": {
        "geocodeServerUrl": ...,
        "naServerUrl": ...,
        "printServiceUrl": ...,
        "geometryServerUrl": ...
    }
}

instead we the helper urls should be reference like:

{
    "organization": {
        "helperServices" {
            "geocode"[{
                    "url": ...
                }
            ]
        }
        "route": {
            "url": ...
        }
        "printTask": {
            "url": ...
        }
        "geometry": {
            "url": ...
        }
    }
}

Then in the template we can reference the geometry service url as {{organization.helperServices.geometry.url}}

Geocoding as an array would be something like this for the default locator {{organization.helperServices.geocode[0].url}}

We we construct the template replacement dictionary prior to deployment we should pull all properties from portal/self into this object. This will give us more flexibility to expand and take advantage different properties from the organization/portal in the templates.

We should also pull all the properties form the logged in user under the "user" object: https://developers.arcgis.com/rest/users-groups-and-items/user.htm

{
    "username": "jsmith",
    "id": "61e2ab78ff17b5fda94a8a212ba5df10",
    "fullName": "John Smith",
    "availableCredits": 479.50998,
    "assignedCredits": 500.0,
    "firstName": "John",
    "lastName": "Smith",
    "preferredView": "Web",
    "description": "Senior GIS Analyst for the city of Redlands.  ",
    "email": "jsmith33@esri.com",
    "idpUsername": "null",
    "favGroupId": "829e32cca4dd475a8bb63bb56b16fe3e",
    "lastLogin": 1385766284000,
    "mfaEnabled": false,
    "access": "public",
    "storageUsage": 583650,
    "storageQuota": 2147483648,
    "orgId": "qWAReEOCnD7eTxOe",
    .......
chris-fox commented 4 years ago

Verified