Hi,
We have various APIs to use in AEM coding: jcr api, Jackrabbit API, wcm api and sling api.
How do we choose from these APIs?
I would think I should use Sling API, as it is a high level one and probably this is Adobe's expectation also.
Appreciate your responses.
Thanks,
Rama.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
In general, these APIs just work on different levels of abstraction, and using a high-level APIs is often recommended, as sometimes the layout on the repository level is well-known, but technically an implementation detail and could change with every release. So, start with the API on a WCM level, and all resource-handling should be done using the Sling Resource API.
The only reason to use the JCR API is only the use of nodetypes, which is often required, but not supported by Sling.
kind regards,
Jörg
Views
Replies
Total Likes
Hi,
Your question seems to be too generic.
Thanks
Views
Replies
Total Likes
I mean to ask:
1. Why so many APIs are created?
2. Given that all these APIs serve our purpose, which one to use?
Something like, use high level APIs (Sling APIs) in general, but if more fine grained function calls are required, use JCR API.
Something like JCR API has performance benefits.....
Adobe recommends ......
Thanks,
Rama.
Views
Replies
Total Likes
Reason being Apache Sling is not a Adobe product
again Adobe CRX is based on Apache JCR
All these are designed and developed individually for various purpose but when you combine these you get different ways to do a particular task
Views
Replies
Total Likes
As Praveen stated - the API you use all depends upon what you want to do. AEM is a large product with many pieces of functionality. Hence is the reason why there are many APIs for that reason.
For example - if you wan to programmatically work with DAM Assets - you use the AssetManager API. If you want to create a custom workflow - you use the AEM Workflow APIs. If you want to query the JCR - you can use QUeryBuilder API or JCR API. If you want to work with databases, you can use the DataSourcePool API.
We have a lot of community articles that get you up and running with the various AEM APIs. You can see them here:
https://helpx.adobe.com/marketing-cloud/experience-manager.html
Hope this helps.
Views
Replies
Total Likes
Hi,
I understand this part.
My only question is if the same specific function could be achieved by JCR API, Sling API, WCM API and Jackrabbit API, which API should the developer choose?
Are there any parameters to consider?
Thanks,
Rama.
Views
Replies
Total Likes
Hi,
In general, these APIs just work on different levels of abstraction, and using a high-level APIs is often recommended, as sometimes the layout on the repository level is well-known, but technically an implementation detail and could change with every release. So, start with the API on a WCM level, and all resource-handling should be done using the Sling Resource API.
The only reason to use the JCR API is only the use of nodetypes, which is often required, but not supported by Sling.
kind regards,
Jörg
Views
Replies
Total Likes
Perfect. This is the kind of answer I have been waiting for.
Now my knowledge on this topic got enhanced.
Many thanks to all who replied.
Rama.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies