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

IHubContent should have metadata, and provide a way to fetch it #353

Closed
tomwayson opened this issue Sep 2, 2020 · 5 comments
Closed

IHubContent should have metadata, and provide a way to fetch it #353

tomwayson opened this issue Sep 2, 2020 · 5 comments
Assignees

Comments

@tomwayson
Copy link
Member

tomwayson commented Sep 2, 2020

follow up from #330 and related to #322 (but more limited in scope).

As I indicated in #322 (comment), I think getContent() should return metadata when it exists (i.e. when fetching from the Hub API). I'm not sure that it should proactively make an async request to get it otherwise. We can start by adding something like getContentMetadata() that would fetch it from wherever the enrichment currently fetches it from and the client can call that as needed.

@tomwayson tomwayson added this to the Content views MVP milestone Sep 2, 2020
@drewdaemon
Copy link
Contributor

drewdaemon commented Sep 2, 2020

@drewdaemon
Copy link
Contributor

@ajturner
Copy link
Member

ajturner commented Sep 2, 2020

This is a good plan. However, please be aware that the purpose of getContent() and other Hub.js functions is to provide a clear, consistent interface to the Hub models. it's not just a wrapper for promise chains :)

Specifically, in the near future item editors will be able to configure their metadata display. By far the most common request is to choose what shows in "Last Updated" because it's often not the "ArcGIS Item edited date" but instead some real-world date when a surveyor went into the field. Therefore, the Content.publishedDate may be coming from Content.publishedDateSource = 'metadata.dataIdInfo.idCitation.date.pubDate' such as from DC Trees.

So the getContent() call will look at it's display configuration (likely in either item.properties or another sidecar in resources) to know it should fetch this information and merge specific results into the core content model. @tomwayson @drewctate @mikeringrose

@tomwayson tomwayson self-assigned this Sep 4, 2020
@tomwayson
Copy link
Member Author

Looks like the hub-indexer uses https://www.npmjs.com/package/fast-xml-parser to parse the metadata XML response, and it looks like we can use that in a browser and it's only 5.5kB gzipped, so I'll plan to implement this using that library. The parser is configured here.

@tomwayson
Copy link
Member Author

relies on Esri/arcgis-rest-js#738

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

No branches or pull requests

3 participants