Wednesday, April 5, 2017

How to create custom renderer for a file type in AEM

Use Case:

Honestly use cases for this could be different based on what you want to change in response for a specific file type. We will take an example where we want to add some custom header for a PDF file based on what author has added in property of that file. For example here if author has added a canonical url and no index property, then we want to add these property in response header of all pdf file request.

Prerequisite:

Note that in order to make these property available for asset, you have to override asset editor as well. One example of adding extra property to asset editor is here http://www.wemblog.com/2013/01/how-to-associate-cug-with-dam-asset-in.html

Implementation:
Key here is OptingServlet https://sling.apache.org/apidocs/sling7/org/apache/sling/api/servlets/OptingServlet.html which get invoked on every request. Here is one example

Note: Let me know if you have any question about implementation.

61 comments:

  1. Excellent and nice post. It will beneficial for everyone. Thanks for sharing such a wonderful post. Avail No 1 custom essay writing help UK from certified PhD writers. It is extremely helpful for me. You can email us at info@ukdissertationhelp.co.uk or Phone Number - 020 8144 9988

    ReplyDelete
  2. My Assignment Services is one such Online Assignment Help provider which provides a helping hand to all your academic related queries. They have a lot of professional experts who are skilful in giving you guidance and providing you with cheap assignment help services. You are free to contact their experts by visiting their website and get your pending presentations completed on the time. Given below are some of the steps that they follow while drafting your assignments. Many students see that Assignment Help UK experts are proficient in writing your assignments but no one wonders the reason behind it. However, students pursuing IT need to understand the concepts of Java because it holds down the concept of object oriented programming. The programming concepts are complex to understand and brings a havoc to students, that is why, My Assignment Services bring you our online assignment help services. Taking out some time to consider and contrast about what options that you have that you can include by writing them on a piece of paper. You can also contact some real time Deakin Referencing Generator experts to assist you with the following topics.

    ReplyDelete
  3. Thanks a lot for sharing this blog. I was searching for this topic for a while. Glad that I came across your blog. Great effort. Do share more.
    Cloud Computing Training in Chennai
    DevOps Training in Chennai
    Cloud computing Training
    RPA Training in Chennai
    AWS Training in Chennai
    Cloud Computing Courses in Chennai

    ReplyDelete
  4. You can take the help of assignments from AbAssignmentHelp. They provide assignment help services in the UK for more than a decade for universities and colleges.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Wow its great post. I searched online many times these types of post. I am happy to find this wonderful blog. Thank you very much for sharing this blog with us. I must share this with others. If you Do my Assignment.

    ReplyDelete
  7. Thank you for sharing this informative post.MyAssignmenthelp is giving assignment help to students.we are already trusted by thousands of students who struggle to write their academic papers and also by those students who simply want paper writing service
    to save their time and make life easy.

    ReplyDelete
  8. Awesome content! You have shared an informative blog post. I am an online paper writing services expert and this piece of information helps me a lot.

    ReplyDelete
  9. Wondering for the free instant essay typer online? Your search ends here as you can have your essays, assignments, articles etc instantly.
    At Essayassignmenthelp, the strength of 500+ experts, we guarantee to provide you impeccable college essays at very reasonable prices that any student can afford to. We never compromise with our quality while providing reasonable essay writing help. Our experienced essay writers understand what phrases and sentences the essay evaluators want to see in the content.

    ReplyDelete
  10. The following is a list of PROPERTY MANAGEMENT COMPANY in new York City rental property managers in our database.

    ReplyDelete
  11. We have some important evaluative essay topics which range from educational system to politics. The students can choose from these topics or they can also select a topic of their own.

    ReplyDelete
  12. This is an awesome post.Really very informative and creative contents.
    SEO company in Chennai

    ReplyDelete
  13. Nice to see this blog. Really this is an amazing blog and also informative and valuable. Visit for
    Programming Assignment Help
    My Assignment Help

    ReplyDelete
  14. Packers and Movers Hyderabad Give Certified and Verified Service Providers, Cheap and Best ###Office Relocation Charges, ***Home Shifting, ✔✔✔Goods Insurance worth Rs. 10,000, Assurance for Local and Domestic House Shifting. Safe and Reliable Household Shifting Services in Hyderabad with Reasonable Packers and Movers Price Quotation @ Packers And Movers Hyderabad

    ReplyDelete
  15. if you are searching for assignment help then i suggest you contact us. We provide the best assignment help online at affordable prices.
    Assignment Help Australia
    my assignment help

    free grammar check

    ReplyDelete
  16. Nice image visibility and well written blog. Thanks for sharing. I have recently come across a new online service provider company which provides Shifting Services .
    Packers And Movers Bangalore

    ReplyDelete
  17. it was exceptionally valuable for me.keep sharing such thoughts later on also. A debt of gratitude is in order for sharing the valuable data. phd dissertation help

    ReplyDelete
  18. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites! @ Packers and Movers Ahmedabad

    ReplyDelete
  19. Excellent information Providing by your Article, thank you for taking the time to share with us such a nice article. Amazing insight you have on this, it's nice to find a website that details so much information about different artists. Kindly visit the LiveWebTutors website we providing the best assignment help services in Australia.

    For More Info: Online Assignment Help

    ReplyDelete
  20. I suggest all members choose assignment help Australia for the best guideline in your academia. The perfect and expert assistant your requirement and learning assignment project by the university.

    ReplyDelete
  21. Facing Issue In Installing The Printer With Laptop Contact Epson Support

    You want to install the printer with the laptop but you are confronting some issue, contact Epson Support. You will get information regarding how to install the printer on the Internet but you still need more information then please free to contact us. Our professionals will accurately assist you. We have highly talented professionals who work with dedication and commitment all round the clock. Moreover, we promise to keep your account details secure.

    ReplyDelete
  22. Get Necessary Troubleshooting Guidance At Hp Support Assistant

    Whenever you find the need of the right troubleshooting guidance for the purpose of troubleshooting all technical or non technical problems, you need to avail Hp Support Assistant directly from the professionals who will help you to eradicate the whole host of your printer related problems in a couple of seconds.


    ReplyDelete
  23. Nice blog, it's so knowledgeable, informative, and a good-looking site. Myassignmenthelpau is a great platform that has been performing astonishingly well. If yes, then you are on the right platform to receive the best Essay writing service at an affordable price. They provide transparent and trusted work satisfying universal clientele each year.

    ReplyDelete
  24. Thanks for sharing such a valuable information...
    SEO Training in Bangalore | SEO Course Fees | Best SEO Classes - Join SEO Training in Bangalore at i Digital Academy and learn how to increase your website Traffic by
    Google Certified Trainers with 100% Placements and affordable course fees. Book a Free Demo!

    ReplyDelete
  25. If you are facing problem in your printing devices and you want to keep a regular check on your device, for example Scanning issues such as mechanism faults, firewalls and error messages, HP Printer Not printing, disconnection of the printer, and print the stuck job in the print line can also be quickly identified and solved. For that you have to take assistance from HP Printer Support. Tell us the issue so we get you to the right step and so that we can offer relevant tips.

    ReplyDelete
  26. Have you got locked out of your Mac, It's easy to panic if you are facing the situation but you can reset it and get back in to your mac account. you have to follow some steps and you will be able to reset mac computer. and you can also contact mac

    ReplyDelete
  27. If one is using an HP Laptop with a touch screen then sometimes people wants to turn off the touch screen of their laptop to work properly on it. If you want to know more about how to turn off the touch screen on HP laptop.

    ReplyDelete
  28. Great, i must say and thanks for sharing this informative post.I am really impressed that there is so much information about this subject that have been uncovered and you’ve done your best, MyAssignmenthelp.com is giving help to students who is stressed with their homework help and submit their assignment on time.we are already trusted by thousands of students who struggle to write their academic papers and also by those students who simply want homework academic writing service to save their time and make life easy

    ReplyDelete
  29. Nice blog, it’s so knowledgeable, informative, and good looking site. I appreciate your hard work. Good job. Thank you for this wonderful sharing with us. Keep Sharing.
    Digital Marketing Course In Kolkata
    Web Design Course In Kolkata

    ReplyDelete
  30. www.SingaporeAssignmentHelp.com is a platform where you can get all your assignment help; these assignments can be associated with cheap essay writing service

    ReplyDelete
  31. Top Salesforce Consulting FirmsI really want to appreciate the way to write this article.Salesforce Consulting Company It seems that you are very professional and intelligent on the above topics of writing. What Is Salesforce Trailhead

    ReplyDelete
  32. IAS Coaching In DelhiI really want to appreciate the way to write this article.UPSC Coaching In DelhiIt seems that you are very professional and intelligent on the above topics of writing. UPSC Coaching In Mukherjee Nagar

    ReplyDelete
  33. My Assignment help have a wide range of professional essay typer ready to provide essay assignment help or essay help to the students by presenting top quality essays, keeping in mind the instruction provided by their professors.

    ReplyDelete
  34. Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.
    ccna course in Chennai
    ccna Training in Chennai
    ccna Training institute in Chennai
    ccna institute in Chennai
    Best CCNA Training Institute in Chennai

    ReplyDelete
  35. If you are struggling with your leadership assignment help and need urgent leadership assignment writing help then contact us anytime to avail our finest academic writing help. Our aim is to help you in achieving excellent grades and enhance your career growth.

    ReplyDelete
  36. Quite interesting post you made. It's good shared information and the article is pretty helpful. I like the write-up's structure and flow, as it kept me engaged all this time. Read more- assignment help

    ReplyDelete