You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (Jira)" <ji...@apache.org> on 2019/08/27 08:11:00 UTC

[jira] [Comment Edited] (SLING-8655) Add an Annotation to Sling Model to mark a property to be Externalized

    [ https://issues.apache.org/jira/browse/SLING-8655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16916503#comment-16916503 ] 

Radu Cotescu edited comment on SLING-8655 at 8/27/19 8:10 AM:
--------------------------------------------------------------

[~schaefa], I quickly reviewed the PRs and I'm not really convinced we need an injector + a new API for this use-case. IMO link externalization cannot be solved with a one-bullet solution. It's a personal opinion, but I really like what Provision has done at [1] and I think that externalization is a site-specific task (contrary to instance-specific). Continuing this reasoning, I'd suggest to handle externalization directly in the application code. (cc [~sseifert])

For JSON you could build your own JSON serializer and mark the path properties as being serialized with it.

[1] - [https://wcm.io/handler/url/general-concepts.html]


was (Author: radu.cotescu):
[~schaefa], I quickly reviewed the PRs and I'm not really convinced we need an injector + a new API for this use-case. IMO link externalization cannot be solved with a one-bullet solution. It's a personal opinion, but I really like what Provision has done at [1] and I think that externalization is a site-specific task (contrary to instance-specific). Continuing this reasoning, I'd suggest to handle externalization directly in the application code.

For JSON you could build your own JSON serializer and mark the path properties as being serialized with it.

[1] - [https://wcm.io/handler/url/general-concepts.html]

> Add an Annotation to Sling Model to mark a property to be Externalized
> ----------------------------------------------------------------------
>
>                 Key: SLING-8655
>                 URL: https://issues.apache.org/jira/browse/SLING-8655
>             Project: Sling
>          Issue Type: New Feature
>          Components: Sling Models
>    Affects Versions: Sling Models API 1.3.8
>            Reporter: Andreas Schaefer
>            Assignee: Andreas Schaefer
>            Priority: Major
>             Fix For: Sling Models API 1.3.10
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> For Peregrine CMS we use Sling Models to obtain data in JSon format to be rendered on the client side. This means that the returned content is not externalized aka paths are not mapped to the external view.
> Sling Model should have an Annotation (@ExternalizedPath) that marks a property to be externalized when loaded.
> In order to be flexible the Externalized Path Injector should be pluggable so that customers can add their custom Externalized Path Providers if they choose to do so. By default there is a provider that uses the Resource Resolver's map() function.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)