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

F/content metadata #375

Merged
merged 7 commits into from
Sep 15, 2020
Merged

F/content metadata #375

merged 7 commits into from
Sep 15, 2020

Conversation

tomwayson
Copy link
Member

introduces getContenMetadata() that fetches item metadata and parses it as JSON.

@mikeringrose as mentioned in #353 (comment), this uses same library (although a more recent version) and equivalent configuration as TheDuke does to parse the metadata as JSON. The major difference is that getContentMetadata() uses @esri/arcgis-rest-portal under the hood to fetch the metadata from portal. The long term hope is that we could use this code in TheDuke (someday). Can you please look for anything that would prohibit that.

AFFECTS PACKAGES:
@esri/hub-common
@esri/hub-content
…eturn it as JSON

AFFECTS PACKAGES:
@esri/hub-content

ISSUES CLOSED: #353
Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,28 @@
import { getItemMetadata } from "@esri/arcgis-rest-portal";
import { IHubRequestOptions } from "@esri/hub-common";
import { parse } from "fast-xml-parser";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what we use in the indexer @mikeringrose ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is, though this PR is using v3.x, but indexer uses 2.x, and there are a few differences in the configuration settings and default behavior between the versions. I've made the equivalent configuration in this PR, but there are still slight differences in how the XML is parsed. For example, the peXml node is not parsed by v2 b/c it contains a nested XML document, but v3 parses that XML in place. See https://github.com/Esri/hub.js/pull/375/files#diff-720828cca6aaaac8de88dda7278ca80fR317-R324

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what we use. I wish we would have turned to it into nicer json, but it is what it is.

@tomwayson tomwayson merged commit e055368 into master Sep 15, 2020
@tomwayson tomwayson deleted the f/content-metadata branch September 15, 2020 15:52
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

Successfully merging this pull request may close these issues.

3 participants