AEM Tutorial #11 | Sling Model #2 | Create Component with Sling Model in AEM 6.5

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024
  • Create component using sling model in AEM 6.5. Sling model written using SlingHttpServletRequest adaptables and @Via, @ScriptVariable, @ValueMapValue, @SlingObject and @Self annotations.
    Git Repo : github.com/aem...

ความคิดเห็น • 43

  • @UskeShorts
    @UskeShorts 2 ปีที่แล้ว

    Nice 🙏

    • @AEMGeeks
      @AEMGeeks  2 ปีที่แล้ว

      Thanks Vivekanand Uske

  • @swadeepsachan6690
    @swadeepsachan6690 3 ปีที่แล้ว +1

    Sir you are like extracting away the basics and going to the level which beginners are not able to understand .... lectures are awesome no doubt ... but basic's are missing like how dialog created ,what all properties to be added ..please explain more on basics like if the basics are clear then the curiosity will be there to learn in a better as their is no such platform where the things are explained in this way which is best among all

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว +1

      Yes Swadeep Sachan, you are correct. This tutorial is to explain Sling Model and also need basic knowledge of Component and dialogs. But purpose of this tutorials was to let you understand basics of sling Model in context of component back end. I am taking you idea and will try to start a new series/playlist for absolute beginners.
      This whole series/playlist is for AEM back end development and need some AEM prior knowledge.

    • @ankitawarnulkar7073
      @ankitawarnulkar7073 3 ปีที่แล้ว +2

      @@AEMGeeks Sir awesome tutorials but please start basic tutorials soon. I think most of us dont have good understanding about basics. like what is Resource, ResourceResolver, page manager etc. How to call a resource, how to get a jcr:property in sling. It would be great if you take up these sessions as well. Thank you.

  • @simranjeetsingh2932
    @simranjeetsingh2932 3 ปีที่แล้ว +1

    @ValueMapValue is equivalent to @Inject @Source("valuemap"). How it actually resolves to resource when we are using request as adaptables.

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      It inject resource and then get valuemap from source(resource). This valuemap will contain resource properties.

  • @manikanthamudaliar9901
    @manikanthamudaliar9901 3 ปีที่แล้ว

    Hi AEM geeks
    Thanks for your video it was good but need to know how to do custom adaptable and which scenario we will use custom adaptable.

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      I don't think you need. All use cases have been already covered by OOTB available. I never find any situation, where I had to use custom. If you want to learn for your knowledge, you can.

  • @KeerthiK-rh7yx
    @KeerthiK-rh7yx 2 หลายเดือนก่อน

    Hi AEMGeeks, How to get values of one sling model into another slingmodel.

  • @hungcao1342
    @hungcao1342 2 ปีที่แล้ว

    nice !

  • @keerthikeerthi8162
    @keerthikeerthi8162 3 ปีที่แล้ว +1

    Hi aem geeks, how to display list of child pages when parent page path is given in dialogue using sling model and services.

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว +3

      PageManager pageManager=resourceResolver.adaptTo(PageManager.class);
      Page page=pageManager.getPage("Parent Page Path");
      Iterator pages=page.listChildren();
      1. Get ResourceResolver as per your project setup.
      2. Get PageManager.
      3. Using PageManager get Parent Page.
      4. Use page.listChildren() to get all child pages.
      5. You can Iterate this Iterator(pages) object, which contain all pages.

  • @adityasrivastava9531
    @adityasrivastava9531 3 ปีที่แล้ว +1

    Can you do a video on the Eclipse IDE project setup?
    I saw your Intellij video 2 and 3 , I was'nt able to set up, so only
    asking for eclipse setup

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว +1

      I can create. But as per my experience, Intellij is better then eclipse. I will create tutorial for eclipse and VS code. VS code is also getting popularity for AEM projects.

    • @adityasrivastava9531
      @adityasrivastava9531 3 ปีที่แล้ว

      @@AEMGeeks I have all the Ide's just not able to sync it with localhost.
      Eclipse I was able to do.
      Yes Visual code is also now becoming popular

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      I will create a separate playlist for these kind of adhoc topics. Just want current playlists to stick to relevant topics. Will create tutorials.

  • @sanjanagoswami941
    @sanjanagoswami941 2 ปีที่แล้ว

    What is the key difference between getTitle() and getPageTitle()?

  • @shiva9839
    @shiva9839 2 ปีที่แล้ว

    @self does it also work to inject other sling models?

    • @AEMGeeks
      @AEMGeeks  ปีที่แล้ว

      self can't be use to inject other sling model

    • @shiva9839
      @shiva9839 ปีที่แล้ว

      @@AEMGeeks how to inject other models? also I have one more query earlier with USE api we were able to inject services is that deprecated now?

    • @AEMGeeks
      @AEMGeeks  ปีที่แล้ว

      @@shiva9839 USE api means, you are talking about WCMUSE. Backend used before sling model came. In sling Model you can use @OSGiService to call service in sling model.
      to inject other sling model, get ModelFactory using @OSGiService. than get other model by modelFactory.getModelFromWrappedRequest(). Please read documentation about how to use this method. This method take 3 arguments. request, resource and sling model class which you are trying to inject.

  • @dekkab2689
    @dekkab2689 3 ปีที่แล้ว

    Hi@geeks, page title is not coming

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      Do you have page and title, what you are referring in code. You can take code from git and try.
      git : github.com/aemgeeks1212/aemgeeks

  • @rudramitra7609
    @rudramitra7609 3 ปีที่แล้ว

    Hi, How to know which adaptable to use base on your properties.

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว +2

      If you need only dialog properties then you can use Resource. But if you need to inject any other object ex Page, then please use SlingHttpServletRequest or use accordingly as per need

  • @robinaliazfrancis1
    @robinaliazfrancis1 3 ปีที่แล้ว

    Page title is not coming. I have changed the adaptables. But still showing error.

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      Robin Namasthe Thozha, What error you are getting. Can you check your current page has title. What annotation you are using to inject Page.

    • @robinaliazfrancis1
      @robinaliazfrancis1 3 ปีที่แล้ว

      @@AEMGeeks cannot access page title
      Java.lang.reflect.InvocationTargetException: null

    • @robinaliazfrancis1
      @robinaliazfrancis1 3 ปีที่แล้ว

      @@AEMGeeks I identified the issue. I missed to add name in @scriptvariable. Now it working. Thanks for the reply

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      Great Robin Namasthe Thozda, Its always great feeling to debug your own code and fix issue. It will give you confidence for further learning.

  • @shaliniraghuvanshi7282
    @shaliniraghuvanshi7282 3 ปีที่แล้ว

    When to use adaptable as resources and when slinghttpservletrequest

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว +2

      if you need only component/resource properties then you can use resource. but if need other objects as well like page then you should use slinghttpservletrequest. If you are not sure about what you will need then use slinghttpservletrequest.

    • @ochoax2628
      @ochoax2628 2 ปีที่แล้ว

      @@AEMGeeks Hi Geek, I'm still don't understand what is the difference between using Resource.class and Slinghttpservletrequest. I've checked many resource on internet to find something related to these 2 adaptables. As far as i know everything is a resource but what you do mean using other objects like page should use slinghttpservletrequest. How do I know which adaptables to use.

  • @prasanthmondithoka5364
    @prasanthmondithoka5364 2 ปีที่แล้ว

    For aem developer is enough to learn these videos or we need to learn extra topics

    • @AEMGeeks
      @AEMGeeks  2 ปีที่แล้ว

      I have already covered almost all the topics. You should be good of you follow and practice the topics available over this channel. I will also keep covering other topics in future.

  • @shubhamsuryavanshi8472
    @shubhamsuryavanshi8472 3 ปีที่แล้ว

    When to use @Via and @Source can you please explain ?

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      I have already explained in another tutorial, Please check once.

  • @kirankumars5330
    @kirankumars5330 3 ปีที่แล้ว

    Page title is not coming. Also after injection resource or page , I see nulls while debugging .Do I need to add any dependencies.

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      kirankumar s, you might missing something. Please check all annotations are written and adaptables is also updated with SlingHttpServletRequest.class. Please get tutorial code from git and try at your machine/system.
      github.com/aemgeeks1212/aemgeeks

  • @pavanssb2570
    @pavanssb2570 3 ปีที่แล้ว

    Error during include of component '/apps/aemgeeks/components/registration'
    Error Message:
    org.apache.sling.api.SlingException: Cannot get DefaultSlingScript: Identifier com.aem.geeks.core.models.Author cannot be correctly instantiated by the Use API

    • @AEMGeeks
      @AEMGeeks  3 ปีที่แล้ว

      You might be missing something. Take code from git repo. Build at your local and deploy to your local AEM. Don't forget to create pages in aem.
      github.com/aemgeeks1212/aemgeeks