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

tagging an undefined "rel" per default as "alternate" #7

Open
allixender opened this issue Jul 12, 2017 · 0 comments
Open

tagging an undefined "rel" per default as "alternate" #7

allixender opened this issue Jul 12, 2017 · 0 comments
Labels

Comments

@allixender
Copy link
Member

There is a bug in the Owc GeoJson Scala Play JSON lib, that tags an undefined rel default as "alternate". Actually we don't need the rel attribute immediately in the JSON encoding, and we can use the uuid to store and easily distinguish which OwcLink goes into what List (contentByRef, ResourceMetadata and similar), but for e.g. for a subsequent parallel support of OGC OWC ATOM encoding we also need to keep the rels proper:

It needs to be added to the OwcContext and OwcResource JSON parsers, to send default "rel" depending for which JSON path they are parsing:
some Pseudo code here:

case OwcContext => {
        val specReference = owcContext.specReference.map(o => changeRelForOwcLink(o, "profile")) // links.profiles[] and rel=profile
        val contextMetadata = owcContext.contextMetadata.map(o => changeRelForOwcLink(o, "via")) // aka links.via[] & rel=via
        owcContext.copy(specReference = specReference, contextMetadata = contextMetadata)
}
case OwcResource => {
        val contentDescription = owcResource.contentDescription.map(o => changeRelForOwcLink(o, "alternate")) // links.alternates[] and rel=alternate
        val preview = owcResource.preview.map(o => changeRelForOwcLink(o, "icon")) // aka links.previews[] and rel=icon (atom)
        val contentByRef = owcResource.contentByRef.map(o => changeRelForOwcLink(o, "enclosure")) // aka links.data[] and rel=enclosure (atom)
        val resourceMetadata = owcResource.resourceMetadata.map(o => changeRelForOwcLink(o, "via")) // aka links.via[] & rel=via
        owcResource.copy(contentDescription = contentDescription, preview = preview,
          contentByRef = contentByRef, resourceMetadata = resourceMetadata).asInstanceOf[OwcResource]
}
@allixender allixender added the bug label Aug 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant