I downloaded the Enterprise SDK v11.1 and only found the command line utility for creating the custom data feeds nodejs project, however, the documentation seems to be from an older version maybe even 10.9.1, and no documentation on custom data feeds, and no samples.
Where are the samples? I don't see them on github either, and the online documentation for the SDK doesn't have anything on custom data feeds either.
Running into the same. Were you able to register?
I was. I made the mistake of installing node packages at the top level of the project. Once I installed the packages at the provider level, I managed to register it with the server.
Just an update - it turns out the ArcGIS Server Custom Data Feed runtime is just NodeJS app running on the ArcGIS Server, and the CDF feature class does not behave just like any other feature service. There are performance issues, esp with the filter widgets in WAB and ExB, and there's a caching bug in 11.1 that will cache it forever if you set any ttl value.
I saw you can override the key the cache uses which is helpful because we don't have a ::layer on our service, i.e. it will always be 0 and was causing the plugin source to be called again sometimes.
Model.prototype.createKey = function(req) {
let key = req.url.split('/')[1]
if (req.params.host) key = [key, req.params.host].join('::')
if (req.params.id) key = [key, req.params.id].join('::')
return key
}
How can I also have my provider optionally return a table instead of a feature service that can be added to Field Maps for example as a lookup table for a drop down, or am I pushing it here?
I found that if you just exclude the geography from the geojson it returns a table.
it seems like you would create a relationship class to do what I was asking in field maps between a feature class and the table created by cdf. However at least in my local host environment the table can’t be used in the go tool. It just has an x by it nothing else
Here there is the documentation & samples: - Overview ArcGIS Server Custom Data Feeds
Have you found any information or samples that include caching?
I have seen in create service property set 'true' but I don't know if it is managed this property with CDF
"properties": {
"disableCaching": "true"
},
I had to figure it out myself. I allowed a url parameter to be passed called expiresDays so I can use different caching for different projects. I also have a default expiresDays in my config file
let expiresDays = req.query.expiresDays || config.expiresDays
let expires = null
if (expiresDays && expiresDays !== 0) {
expires = new Date().setDate(new Date().getDate() + expiresDays)
}
// set the fields array where I used aliases, and the array of features, then set ttl
const geoJson = {
metadata: {
idField: "OBJECTID",
fields: fields,
displayField: Object.keys(allFeatures[0].properties)[0]
},
type: "FeatureCollection",
features: allFeatures,
ttl: expires
}
Model.prototype.createKey = function (req) {
let key = req.url.split("/")[1]
if (req.params.host) key = [key, req.params.host].join("::")
if (req.params.id) key = [key, req.params.id].join("::")//if (req.params.layer) key = [key, req.params.layer].join('::')
return key
}
How do you get access to the key once another request is made?