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

Justin Edelson commented on SLING-6652:
---------------------------------------

Sorry, I'm not making myself clear. What I mean is something like:

{code}
@Exporters{
   @Exporter(name = "jackson", extensions = "json", selector = "metadata", 
options = {
      // whatever options are needed for the metadata output
   }),
  @Exporter(name = "jackson", extensions = "json", selector = "data", options = 
{
      // whatever options are needed for the data output
   })
}
@Model(...)
public class AImpl {}
{code}

Now obviously the wildcard is here is whether or not you can actually do what 
you need with the options available. If not, can new options be supported which 
do what you need? For example, one thing I was toying with was the idea of 
making the inclusion of Jackson Modules conditional (right now, if you create a 
{{ModuleProvider}} it gets applied all the time). 

> Allow multiple adapters for Models with resourceType binding
> ------------------------------------------------------------
>
>                 Key: SLING-6652
>                 URL: https://issues.apache.org/jira/browse/SLING-6652
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: Sling Models Impl 1.3.0
>            Reporter: Dirk Rudolph
>
> According to 
> http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java?view=markup#l59
>  the AdapterImplementations support only mapping resourceType to Adapter 1:1. 
> I would like to propose extending that to support 1:n binding between 
> resourceType and adapter classes.
> My use case: 
> Lets assume I want to combine my models with the exporter framework to export 
> 2 representations of a single resource:
> * metadata
> * data
> To do so I would create 2 models, each bound to the same resourceType but 
> annotated to be exported for different selectors. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to