I apologize. I think I missed the “serving up large number of virtual 
resources” part of your requirements.
You can use JCR nodes just to create resources that map to your resource type 
and still get your data from anywhere.
But if resource path itself needs to be dynamic or it’s difficult to manage JCR 
nodes for those resources then a better approach would be create a “fake” 
resource as you are doing.
You may have such a use case. This is probably the part of your requirement 
that I missed.

BTW I do apologize if I came across like I was questioning your experience. I 
did not mean it that way at all. I do have a lot of experience with Sling and 
CQ/AEM as well. :)  

> On Jan 31, 2017, at 12:57 PM, lancedolan <lance.do...@gmail.com> wrote:
> 
> Henry Saginor-2 wrote
>> Hi Lance,
>> 
>> I think a better practice is to register your servlet with a resource type
>> instead of path.
> 
> This requires creating a node per resource. Please see my prior post where I
> disqualify all solutions that involve creating nodes. My entire requirement
> is that I'm creating a service that serves data that isn't in the JCR. I
> truly do appreciate your taking the time out of your day to try to help me,
> though, so I hope you don't feel slighted! :) I have been lead AEM Architect
> on Sling applications that serve millions of users globally and am already
> familiar with the fundamentals of Sling resource and script resolution :) 

> This is just my first time needing to serve up "virtual" resources of very
> large number like this, such that a dynamic-URL service is absolutely the
> only solution.
> 
> Update: I've made progress with the ResourceProvider solution! It seems the
> 403 response I was getting was actually result of my ResourceProvider
> successfully returning SyntheticResource, which Sling then responded with a
> 403 for...  It seems all I need to learn is how to properly instantiate a
> Resource object and return it :)
> 
> It seems I need to learn about this ResourceWrapper class and how to create
> ResourceMetadata....
> 
> 
> 
> --
> View this message in context: 
> http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4070022.html
> Sent from the Sling - Users mailing list archive at Nabble.com.

Reply via email to