EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM
-
Upload
evolve-the-aem-community-conference -
Category
Technology
-
view
155 -
download
1
Transcript of EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM
![Page 1: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/1.jpg)
#evolverocks
Introduction to Back End Development in Adobe Experience Manager
VARUN MITRA | PARTNER TRAINING INSTRUCTOR
August 30th, 2016
![Page 2: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/2.jpg)
#evolverocks 2
I N T R O D U C T I O N T O B AC K E N D D E V E LO P M E N T
1 | M AV E N A N D A RC H E T Y P E S2 | I N T R O D U C I N G O S G I3 | S L I N G : S E RV L E T S & S C H E D U L E R S4 | S E S S I O N M A N A G E M E N T 5 | Q U E RY O P T I M I Z AT I O N
![Page 3: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/3.jpg)
3#evolverocks
MAVEN AND ARCHETYPES
1. Maven simplifies and provides an uniform build process.
2. Maven makes use of a Project Object Model(POM)
3. pom.xml file defines Project Information, Build Environment Settings and Relationships.
4. A Maven Archetype is a Project Template
![Page 4: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/4.jpg)
4#evolverocks
Introducing OSGI
1. SCR Annotationa. @component: A JAVA class file that can be stopped or started.b. @service: An extesnion of component, can be looked up using its
interface name.c. @reference: Defines References to the other services.d. @properties: Defines properties which are made available to the
component.2. All services are components.3. @component annotation is mandatory in order to use the
rest.4. Use @component(metatype=true) to create custom OSGI
configurations.
![Page 5: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/5.jpg)
6#evolverocks
Sling Servlets
Sling Servlet API extends HTTPServlet class Use @slingServlet annotation to define a Sling Servlet Avoid @slingServlet(paths=‘/bin/foo/bar’) Use @slingServlet(resourceTypes=‘/company/foo/bar’,
selectors=“{‘foo’,’bar’}”) Default Servlet Execution path - /bin Define additional execution path with the help of Apache Sling
Servlet/Script Resolver and Error Handler
![Page 6: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/6.jpg)
7#evolverocks
Sling Scheduling
• Scheduler can implement the Runnable API or make use of the Scheduler Interface.
• Scheduler make use of a CRON expression to execute periodically.
![Page 7: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/7.jpg)
8#evolverocks
Session Management
Use loginService(String subServiceName, String workspace) for providing Super User Access to the repository.
Use ResourceResolver API to obtain the logged in user session
Do not use repository.loginAdministrative or repository.login(userid, password)
![Page 8: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/8.jpg)
9#evolverocks
Query Optimization
Use sling:Folder or oak:Unstructured when large number of sibling nodes are expected and ordering is not required. Use nt:unstructured and sling:OrderedFolder otherwise.
Avoid Queries in components. Use node based API’s if the prior knowledge of the location of data is available. All queries are converted to SQL2 before being run, however the overhead of query
conversion is minimal. Use Explain query tool to understand how a query would be executed. Enable debug on Query API’s to further analyse the Query Performance:
org.apache.jackrabbit.oak.plugins.index org.apache.jackrabbit.oak.query com.day.cq.search
![Page 9: EVOLVE'16 | Deploy | Varun Mitra | Introduction to Back End Development in AEM](https://reader036.fdocuments.in/reader036/viewer/2022062412/5877d47d1a28abaa6c8b4d3d/html5/thumbnails/9.jpg)
#evolverocks
THANK YOU!