Nothing Special   »   [go: up one dir, main page]

AEM

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 10

AEM Components

1.Why are components come to existance?


2.Definition and Properties
3.Component Cycle
4.AEM OOTB Components
5.AEM Features
6.Structure of Components
7.Properties that present in CRX-DE
8.Custom Components
9.Possibilities of Inheritance
10. Sling Resource Merger- Override vs Overlay
11.Components in Sling Model and Cq Properties
12.Complete Logic how Sling Components is created
13.Difference Between Sling Resource and Sling http request Servlet
14, Annotation that Used in Sling Model
15.Look into Code

Code Feautes:
1.@Inject
String lname;

2.@override
public string get firstname();
Return fname;

3.if optional if Required


@Inject @Inject
@optional @Required
String fname; String fname;

4.Default values
@Inject
@Default (value ="AEM")
String fname;

5. @Model(adaptables =Resource.class
adapters = Author.class;
Default Injection Strategy = Default Injection Strategy.optional;

6.@Script Variable
Page current page;

7.@override
Public String getpage Title(){
Return current page.get Title();
}

8.@Inject
@Via("Resource")
@Default (Value="AEM")
String fname;

9.@ValueMapvalue
@Default (values="Geeks")
String lname;

10.@Slingobject
Resource Resolver resource Resolver;

11.@self
SlingServletRequest.SlingServletRequest;

12.@Resource path("/content/aemgeeks/us/en/name") @Via("Resource")

13.@OSGI Service
querybuilder querybuilder;

14.@Inject
@Named ("Jcr:LastModifiedBy")
String Modified by;

Multifield Dailog
1.Component and Node Structure
2.Difference when composite Added True and False
3.Java Code

Multiple Multifield Dailog


1.1.Component and Node Structure
2.Differnce b/w Multifield with map and Multifield with Bean & Nested Multifield
3.Java Code

Content Fragments
1.Definition and Explaination
2.Architecture of Content Fragment
model --- CF-- Variations --- CF Component --- Raw Json
3. How to Create the content Fragment

Experience Fragments
1.Definition and Explaination
2. How to Create the content Fragment

Diference Between Experience Fragments and Content Fragments

EDITABLE Template
1.What is Template-Definition and Explaination
2.How the Page is Created by using Template
3.Create a Template --Steps
4.Policies used in Templates
5.Page Properties used in Templates
6. Explation of 3 areas
-- Structure
-- Initial Content
-- Layout
7. Dynamically Meaning and Static Meaning
8.How Editable Template is Different From Static Template
9.Reference and Relationship
10.Editable Template Structure
-- Initial
-- Structure
-- Policies
11.Editable Template Folder Structure
12.Template Type Resolution
13.Difference Between Static Template and Editable Template

OSGI Services

1.Definition and OSGI Frameworks


2.Life Cycle of OSGI Bundle
3.Properties of OSGI and Optional method
4.Service Demo-- Calling OSGI Service in AEM
5.Lets see How the Services is Called on backend end Through Demo
6.OSGI Filters
-------------------------------------------------------------------- When
Service Interface Has Multiple Implementations
--MultiService A-impl and MultiService B-impl
Which Service Implementation will Call
-- Service A and Service B
Set @Service Ranking to Call any Service

-- Now Check on Service ID


Call Specific Service in Sling Model
-- Call @ Reference with Target
Call Specific Service in other Services

7.OSGI Configuration
--------------------------------------------------------------- What is
OSGI Configuration in AEM
-- What is OSGI Configuration and Basics Of OSGI Configuration
How to Write the OSGI Configuration using R7 Annotation
-- OSGI Config Fields and Config in nodes
Different Field Types in OSGI Configuration
-- Components anddd Service with OSGI Congfiguration
Save OSGI Configuration as node or file
-- Write the OSGI Configuration using R7 Annotation
Display Configuration in Components
-- look at this
1. @objectclassdefinition
2.Public @Interface Serviceconfig
3.@AttributeDefinition
4.@Designate(-----)
8.Create OSGI Configuration in Separate Files
-- OSGI Configuration in Separate File and then we can call it
-- save the OSGI Configuration as node or File type

Code Feautes:

1.@Active @Deactivate @Modified


Public void Activate(){
LOG.info ("/n-----------inside active----)

2. @OSGI Service
Iterator <page>

3. @OSGIfilter
@service A(1000)
@service B(1001)
4. call @OSGIservice with filter
@OSGI service
Multiservice multiservice

@override
Public String getname From Service();
return multiservice .get Name();
}
}

5.@serviceRanking (1000) ---- to service A


@serviceRanking (1001) ---- to service B

@Component (Service =multiservice class, Immidiate= true)


@Service Ranking(1001)
Public class Multiservice B Implements Multiservice{

6.@OSGI Service filter


="component.name=com.aem.geeks.core.services.impl.Multiservice impl"
Multiservice Multiservice;

7. Call @Reference with target

@Reference (Target="component.name=com.aem.geeks.core.services.impl.Multiservice
impl")
Multiservice Multiservice;

8. @ObjectClass definition (name="AEM Geeks = OSGI Configuration"


Description= "OSGI Configuration demo")
Public @Interface Service config{

9. Public @ Interface Service Config{

10. @AttributeDefinition
@name name ="Service name"
@Description Description="Enter Service name"
@Type Type= Attribute Type .STRING
@Method Public String ServiceName () Default="AEM geeks
Service"

11.Array Multifield type

String [] getcountries() default {"de","en"};

12.@Designate(ocd=OSGI ConfigurationImpl.Serviceconfig.class)

13.@objectclassdefinition

Servlets

1.definition and life cycl of servlet


2.what is sling servlet and types of servlet
3.Difference between Resource types and path sling servlet
4.Writting servlet using DS methods
5.Servlet extends methods
6.Explain about OSGI DS 1.2(R4)
--@Component(Service= Servlet.Class
Property { -----
----
--- Define}
7.Resource type and path Type --- paths
8.Methods,Extensions and Selectors. ---Extends answer
9.Lets extends classes with get and post menthod
10.Explain about OSGI DS 1.4(R7)
@Sling Servlet Resources Types
@ServiceDescription
@SlingService paths
11.Sling servlet types and process
12.Resource types properties
13.Process od servlet(Resource types properties and pages component, pages and
get/post)
14.path based servlet process

Code Feautes:
1.@Service Description ("Simple Servlet using OSGI DS 1.4)
Public class Sample Path servlet extends
Sling all methods Servlet

@overide
Protected void doget(Slinghttpservlet Request Request,Slinghttpservlet Response
Response)
Throws Servlet Exception, IOException{
}

@overide
Protected void dopost(Slinghttpservlet Request Request,Slinghttpservlet Response
Response)
Throws Servlet Exception, IOException{
}
}
}

2. @Component (Service=servlet.class)
@Sling ServletResource types{
Resource types ="aemgeeks/componet/Structur/page"
Methods =httpconstants.METHOD_GET
Extension ="txt"

@ServiceDescription ("Simple servlet using OSGI DS 1.4)


public class Samplepathservlet extends slingallmethodservlet {

3.@Sling servlet Resourcetypes

4.@SlingServletpaths{
values="/bin/geekspath"

5.@Sling servlet Resourcetypes {


ResourceTypes ="aemgeeks/componet/Structur/page"

Query Builder

1.Definition and types of search API in AEM


2.Repository Search and Query Builder Search Types
3.Path where to search and Procedure to search
4.What is Json Query Builder and use od it
5.Query Builder java API in AEM
6.about serach service in Query Builder
7.Annotation parts Explaination:
@reference
queryBuilder queryBuilder;

2.query query=queryBuilder.getresult();
create (create Textsearchquery(Searchtext)).Session);

3.Searchresult result =query.getresult();

4.List<hits> hits=results.gethits();

5.@reference
Searchservice Searchservice;

6.Type=cq:page
path= /content/aemgeeks
property= cq:template
property value =/apps/aemgeeks/templates/geeks-content
p.limit=-1

Schedular

1.Definition and created by 2 ways


2.what is sling Schedular api and write Schedular
3.2 types of writting Schedular and eplaination
4.org.apache.sling.commons.schedular
5.Difference between Implements runnable interface and Implements job interface
6.what is crone expression and how to add it
7.Scheduling multiple jobs using the schedular
8.Service use job class
@Component(immediate=true,service= job.class)

9.Main difference between job interface vs runnable interface

Service
1.@component(immediate=true,service= job.class) ---- for job interface

@component(immediate=true,service=runnable.class) ---- for runnable interface

Interface
public class geekschedularjobs.implements job; ---- for job interface

public class geekschedularjobs.implements runnable; ---- for runnable interface

10. Multiple jobs in AEM and procedure

Code Feautes:

1.@component(immediate=true,service=runnable.class)

2.@Designate(ocd= schedularconfiguration.class)
3.@Reference
private Schedular Schedular;

4.Private void addschedular(schedularconfiguration config){

Schedular in = Scheduler.EXRP(S: "0 34 26 1/1 *?*");


Schedular.Schedular(0:this is);

Schedular Dubai = Scheduler.EXRP(S: "0 14 77 1/1 *?*");


Schedular.Schedular(0:this Dubai);

Schedular Us = Scheduler.EXRP(S: "0 15 16 1/1 *?*");


Schedular.Schedular(0:this Us);

5.Schedular Option in = Schedular.EXRP(S: "0 33 16 1/1 *?*");


map(String,serialization in Map = new HashMap<>();
in Map.put("country","IN")
in Map.put("url","www.in.com")
in Config (in Map)
Scheduler Schedular(0:this, in);

Event-handler

1.Definition and Explaination


2.Event-handler API Framework in 2 types of categories and Explaination
3.JCR Event-handling and explaination
4. Psudo code and see and explain it
---@component(immediate=true,service= Event listener.class)

@Reference
Sling Repository Sling Repository;

@Activate
public void activate () throws exception{
session = SlingRepository.login service("geeks service user", null);

5.OSGI Event-handling API's

EventConstants.EVENT_TOPIC

6.Event constants. Event-Filter


@component(Service= EventHandler.class, immediate=true;
Property={
Eventconstants. EVENT_TOPIC+"=org/apache/sling/api/Resource/ADDED"
Eventconstants. EVENT_TOPIC+"=org/apache/sling/api/Resource/changed"
Eventconstants. EVENT_FILTER+"= (Path=/content/aemgeeks/us.en/author/")}

Public class Sling Event Handler Implements Event Handler{

Resource event :{} at:"{}", event.getTopic()


event.getProperty(SlingConstants,PROPERTY_Path);

7. Sling Resource changeListerner API's and Explaination


ResourcechangeListerner

Property={
Resource change listener.PATHS+="/Content/aemgeeks/us/en/card"
Resource change listener.CHANGES+="ADDED"
Resource change listener.CHANGES+="REMOVED"
Resource change listener.CHANGES+="CHANGED"
}

8. Sling Job Manager and Job Consumer

Code Feautes:

1.@Component (immediate=true, service=Eventlistener.class)


Public class JCR eventhandling Implements Events Listener{

Private session session,

@Reference
Sling Repository Sling Repository;

@Activate
Public void activate () throws Exception{
session = Sling Repository.login service ("geeks service user",null);

session.get- workspace () getobservation Manager();


add EventListener{

this
Event.NODE_ADDED / Event PROPERTIES_ADDED
"/content/aemgeeks/us/en" //Path
True //is Deep?
null //UUID's Filter
null //nodestypes Filter
false
and Down Iterator is loop added

Event Listerner

1.Definition and Explaination

Event.NODE_ADDED---- 1
Event.NODE_REMOVED---- 2
Event.NODE_CHANGED----32
Event.PERSIST -------- 64
Event PROPERTIES_ADDED--- 4
Event PROPERTIES_REMOVED-- 16
Event PROPERTIES_CHANGED-- 8

2. Explain it;

@component(immediate=true,service= Event listener.class)


Public class JCR Eventing Handling Implementents Event Listen{

Register the listener using Observation manager


"null=Default"
there is 7 parameter in @Active
1. this
2. Event.NODE_ADDED / Event PROPERTIES_ADDED
3."/content/aemgeeks/us/en"
4.True
5.null //UUID's Filter
6.null //nodestypes Filter
7.false

Dispatcher

1. Definition and Explaintion


2. Dispatcher setup in multiple operationing system
3. What is purpose of Dispatcher
4. Need of webserver and EXplaination

5. Dispatcher Modular Configuration


1.httpd.conf
2.Dispatcher.any

6.Explain Dispatcher Modular Configuration with points and this below one
1.Dispatcher_Vhost.conf
2.dispatcher.any
3.conf.d
4.conf.dispatcher.d
5.dispatcher.any
6.Cache
7.Filter
8.Vhost

Work-Flow

1.Definition and Work-Flow model process


2.Model Repository
1.Model Design
2.Runtime Design
3.Explain 4 steps in Work-Flow
4.We call Work-Flow in 3 process
5.Create the Work-Flow Model and Launcher
6.Practical procedure
7.Trigger workflow using API
1.Workflow Execution using Backend Code
Imp model in Workflow
1.Workflow model
2.payload

8.Explain the steps we trigger this workflow in backend;

1.Workflowsession Workflowsession=ResourceResolver.adaptto(Workflowsession.class)

2.Workflow model Workflow model = workflow session


get model ("/var/workflow/model/geeks-page-version")

3.Workflow data .Workflow data = workflowsession.new workflowdata


("JCR_PATH",payload);

4.workflow session.Startworkflow(workflowmodel, workflow data);


5.workflow session.Startworkflow(workflowmodel, workflow data);
Map <String.object> Workflow MetaData= New Hash Map<>();
workflow session.Startworkflow(workflow model, workflow data, Workflow Meta
Data);

6.Resource Resolver resource resolver=req.get Resource Resolver();

7.workflow session workflow session= resource resolver.Adapt to (workflow


session.class);

8. String payload =req.getRequest parameter (s:"page").getstring();

9. Status= workflowsession.Startworkflow(workflow Model,workflow Data).getState();

You might also like