Posts

Showing posts with the label aem

AEM in docker

Image
 Hello Everyone, In this post we will see how we can run our aem server from docker. Before that why we really need docker, whenever we have a new team member, they will struggle for project setup. Now imagine we have a set up file we can share with any new member who is joining our team. They simply can start their work without wasting time on set up or we can directly start giving KT, so using docker we can achieve this we can create a docker image and we can share the image with team members. What is docker image ? A Docker image is a lightweight, standalone, and executable package that contains everything needed to run an application, including the application code, libraries, dependencies. Everything in one image. How to create docker image ? 1st get docker installed on your machine/system docker toolbox is deprecated so use docker desktop software.  You might face some challenges while installing and starting docker. Install docker desktop...

Create Custom Template for Experience Fragment in AEM

Image
Hello everyone, In this post we will see how to create custom template for Experience Fragment. Note : Here I am using the same BasePage Component for experience fragment template and for page template. Step 1: Go to CRXde and create a Simple Component with Parsys only. Stet 2:  Navigate to /conf/we-retail/settings/wcm/templates and start creating Template. sling:resourceType:/apps/blog/component/BasePage Step 3: Once template is created you have to allow this template under /content/experience-fragments To allow your custom template under /content/experience-fragments navigate /content/experience-fragments this folder will have property  cq:allowedTemplates   edit property and add path of your custom template (/conf/we-retail/settings/wcm/templates/Sample). Step 4: Now start creating Experience fragment using custom template. Step 5: Once Experience fragment is created author it i.e. ...

Migration from SCR annotation to OSGI Declarative Service

In this post we will see the migration of aem project from SCR annotation to OSGi Declarative service or R6 annotation. From beginning we were using SCR annotations for backend aem development. From AEM 6.2 R6 annotation are introduced and recommended to used R6 annotation. SCR (Service Component Runtime) Annotations : the maven-scr-plugin uses the SCR annotation from corresponding subproject at Apache felix. All annotations are in the org.apache.felix.scr.annotations package. If you want to use scr annotations in your project you have to use below plugin and dependency <plugin>       <groupId>org.apache.felix</groupId>       <artifactId>maven-scr-plugin</artifactId>        <version>1.7.4</version> </plugin> <dependency>      <groupId>org.apache.felix</groupId>       <artifactId>org.apache.felix.scr.annotations</artifa...

Creating or finding .M2 folder

Image
If you are setting up your system for first time, you have installed java set path variable for java and maven both. You checked both are installed successfully but if .m2 & repository both folder are not there in then do the below things. open Command promt run the below command mvn help:evaluate -Dexpression=settings.localRepository It will help you to find the location of .m2 if someone has changed. Also if there is no folder created it will create .m2/repository folder under C:\Users\{user}\ If you run this command for first time it will download repository so it will take some time. That's it and your folder is created. After repository creation make sure you are giving the same path in setting.xml localrepository   <!-- localRepository    | The path to the local repository maven will use to store artifacts.    |    | Default: ${user.home}/.m2/repository   <localRepository>/path/to/local/repo</lo...

Create Custom metadata in aem

Image
Metadata refers to extra data associated with assets that we upload in aem dam so we can describe asset with more details. Follow below steps to create custom metadata schema. Step 1. Navigate Tools ->Asset -> Metadata Schema Click On Metadata Schema. Step 2: Click on Create to create new Metadata Schema. Step 3: Enter name for Schema Form which is suitable for your project Step 4: Click on Edit to Edit Schema which you have created so you can add your custom metadata It will open the schema like above Step 5: Now start adding Custom metadata 1st Click on + sign to add tab once you add tab enter name for tab from settings tab present at right side, you can multiple tabs. Step 6: Under tabs add the different field as per your requirement from Build Form tab. To add field just drag and drop fields from Build Form. Step 7: Add details from Settings tab at right side like Field Label, Map to property, placeholder names. Map to prope...