Details
-
New Feature
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
Description
The page model api response must support in the content link with which an SPA can work. The information an SPA needs contains 2 parts
- How to construct a URL from the link
- Can the SPA invoke the link as an XHR call or should it be a document request (aka normal webpage request)
So, first of all, we need to expose a link. rkauffman indicates having a link relative to the parent mount of the resourceapi is what he needs. From that link, he can always create the resourceapi link himself since he already does this. This means we need to expose something like
_links: {
site: "/site/spa-hap/news/2015"
}
for content element
However, this is not enough. Namely, in an SPA, you also want to know whether the link can be constructed to be an XHR call (within the same SPA) or whether the link is a link outside the current SPA, and thus requires a complete document request (normal webpage request).
Since we plan to also support for a single channel to have multiple SPAs and/or normal rendered webpages, we need to know to which SPA the resolved sitemap item for the link belongs. If it turns out that it belongs to the same SPA as the current request, the link can have some other boolean indicating this, for example
_links: { site: "/site/spa-hap/news/2015" type : 'internal' }
where 'internal' would mean the site link is available within the current SPA. Other values can be 'external' or 'resource' (the latter for a binary which can be accessed with the SPA but also outside the SPA AFAIU)
Note that I will also always include the _self link implying the link for the current matched mount. Thus the complete output would be something like
_links: { self: "/site/resourceapi/spa-hap/news/2015" site: "/site/spa-hap/news/2015" type : 'internal' }
Attachments
Issue Links
- relates to
-
HSTTWO-4268 Let the page model api serialize by default the entire page component hierarchy instead of only containers and items
- Closed
-
HSTTWO-4276 Support that prototype pages can specify the hst:applicationId to be able to indicate to which application a newly create page belongs
- Closed
-
HSTTWO-4277 PageModelApiPipeline should not be possible to be overridden on sitemap item level
- Closed