Monday, January 8, 2018

How to work with Report in CQ / WEM

Use Case: You want to create custom report for any thing in CQ

Prerequisite: Please read very carefully


 What we are covering:

I will give one custom example and guide you how to create report within CQ for your custom requirement.

Q: Where I can find all CQ OOTB reports.
A: You can find them under /etc/reports. You can also navigate to CQ report using siteadmin -> tools-> /reports -> double click on any report

Q: Where is code for OOTB reporting templates and component
A: They can be found under /libs/cq/reporting and API http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/reporting/package-summary.html (I don't think you might have to use these API, Unless there is any specific requirement )

If you read above document very carefully, You will find that not all the reports comes with CQ uses CQ reporting framework. Specially Request log parser report and Disk Usage report.

We will cover CQ reporting example here using CQ reporting framework. For any other report please use example of disk usage or log parser report.

Requirement:

Create CQ report to get Geometrixx product page information. Report should include,

1) Title
2) Tags
3) URL
4) Overview Link
5) Feature Link

You should be able to group report based on Tags. You should also be able to see chart representation of report. You should also be able to export report outside CQ instance.


Solution:

First, Make sure that this can be done using CQ reporting framework. For that go through each field for report and make sure that those are available as properties within that page through "Fix" path and there is no complex logic involve to get that data.

Once you know that this can be done using CQ reports, Start developing report.

Step 1: Create template


  • Create a template for your report. See example under /libs/cq/reporting/templates. 
  • Create node called /apps/cq/reporting/templates
  • Easy is to copy existing report from /libs (I copied user report) to /apps and rename it. In our case I created a report called /apps/cq/reporting/templates/productReport
  • Go to /apps/cq/reporting/templates/productReport/jcr:content/report and assign resource type for your custom report. Also create a property called "rootPath" and assign value as "/content/geometrixx/en/products"
  • Template will look like this.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
    jcr:description="Geometrixx Product Report"
    jcr:primaryType="cq:Template"
    jcr:title="Geometrixx Product Report"
    allowedPaths="[/etc/reports(/.*)?]"
    ranking="{Long}100"
    shortTitle="Product Report">
    <jcr:content
        jcr:primaryType="cq:PageContent"
        sling:resourceType="cq/reporting/components/reportpage">
        <report
            jcr:primaryType="nt:unstructured"
            sling:resourceType="cq/reporting/components/productreport/productreport"
            repVersion="{Long}2"
            rootPath="/content/geometrixx/en/products"/>
    </jcr:content>
</jcr:root>


Step 2: Create Component

  • You can see example under /libs/cq/reporting/components/<I copied userreport>. Copy directory structure under /cq/reporting/components and rename it as productreport
  • Create / Rename (/libs/cq/reporting/components/userreport/userreport to cq/reporting/components/productreport/productreport)
  • Make sure that you have following nodes, /apps/cq/reporting/components/productreport/productreport/charting for creating chart data for grouped items. /apps/cq/reporting/components/productreport/productreport/dialog for existing report dialogs. /libs/cq/reporting/components/userreport/userreport/queryBuilder to specify query that needs to run against the report.
  • Change /libs/cq/reporting/components/userreport/userreport/queryBuilder, nodeType property to "cq:PageContent". Because your page jcr:content node has all those properties that we are looking for in our report.
  • Please see http://dev.day.com/docs/en/cq/current/developing/developing-reports.html#Query Definition if you want to add additional constraint in query. For example give me only those page whose cq:template value is "Something", In that case you would create something like this
N:queryBuilder
    N:propertyConstraints
    [
        N:N0 // array of nodes (name irrelevant), each with the following properties:
            P:cq:template
            P:something
    ]
    P:nodeTypes cq:PageContent
Step 3: Create all Column

  • Once we have query definition to get all pages, Now you can create column to show in your report.
  • For that see example under /libs/cq/reporting/components/userreport and see how each column is configured.
  • You can copy one column from /libs/cq/reporting/components/userreport under /apps/cq/reporting/components/productreport to start with
  • Description about field for a column can be found here http://dev.day.com/docs/en/cq/current/developing/developing-reports.html#Column Base Component
  • For example in our case, we want a Tag column. for that create /apps/cq/reporting/components/productreport/productreport/Tagcol with following definition
  • Now suppose you want overview page path, for that you have to nevigate to Overview node and then show it. In that case definition would look like this

58 comments:

  1. Get Packers and Movers Kolkata List of Top Reliable, 100% Affordable, Verified and Secured Service Provider. Get Free ###Packers and Movers Kolkata Price Quotation instantly and Save Cost and Time. ✔✔✔ Packers and Movers Kolkata Reviews and Compare Charges for household Shifting, Home/Office Relocation, ***Car Transportation, Pet Relocation, Bike SHifting @
    Packers and Movers Kolkata

    ReplyDelete
  2. Allassignmenthelp is a web portal where students get assignment help for all the subjects, with the help of our experts. You will get 100% plagiarism free assignment. Expert’s consultation is also available for students. If they have any query they can contact with our experts anytime.
    assignment help uk

    ReplyDelete
  3. WINNING303 - JUDI BOLA ONLINE | CASINO ONLINE | SLOT ONLINE | POKER ONLINE TERPERCAYA

    TOGEL POKER

    BO POKER

    TOGEL303

    CASINO303

    BOLA303

    * KUNJUNGI SITUS KAMI DI *

    www.winning303.com


    *NB : MENANG BERAPAPUN, PASTI KAMI BAYAR !!! *

    * Melayani LiveChat 7 x 24 Jam Nonstop :
    - WA : +6281717177303
    - BBM : WINNING303
    - LINE : WINNING303*

    ReplyDelete
  4. Excellent and nice post. It will beneficial for everyone. Thanks for sharing such a wonderful post. Avail No 1 Essay writing Services 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
  5. Packers and Movers Pune Provide High Quality ***Household Shifting, Home/Office Relocation, Insurance, Packing, Loading, ###Car Transportation Service Pune and High experiences, Top Rated, Safe and Reliable, Best and Secure Packers and Movers Pune Team List. Get ✔✔✔ Affordable Rate Charts and Compare Quotation and Save Money and Time .
    Packers And Movers Pune

    ReplyDelete
  6. Hire Best Packers And Movers Mumbai for hassle-free Household Shifting, ***Office Relocation, ###Car Transporation, Loading Unloading, packing Unpacking at affordable ✔✔✔ Price Quotation. Top Rated, Safe and Secure Service Providers who can help you with 24x7 and make sure a Untroubled Relocation Services at Cheapest/Lowest Rate
    Packers And Movers Mumbai

    ReplyDelete
  7. Packers and Movers Chennai Give Safe and Reliable ***Household Shifting Services in Chennai with Reasonable ###Packers and Movers Price Quotation. We Provide Household Shifting, Office Relocation, ✔✔✔Local and Domestic Transportation Services, Affordable and Reliable Shifting Service Charges @
    Packers And Movers Chennai

    ReplyDelete
  8. Packers and Movers Bangalore as a Services providing company can make all the difference to your ###Home Relocation experience. Bangalore based Company which offers versatile solutions, Right team that easily reduce the stress associated with a ✔✔✔Household Shifting, ***Vehicle Transportation. we help things run smoothly and reduce breakages and offer you seamless, Affordable, Reliable Shifting Services, Compare Shifting Charges @
    Packers And Movers Bangalore

    ReplyDelete

  9. DAFTAR ID GRATIS SABUNG AYAM ONLINE


    * KUNJUNGI SITUS KAMI DI *

    WWW.ID303.INFO


    MENANG BERAPAPUN, PASTI KAMI BAYAR !!! *


    * Melayani LiveChat 7 x 24 Jam Nonstop :

    - WA : 08125522303
    - BBM : CSID303



    BONUS JACKPOT SABUNG AYAM ONLINE


    DEPOSIT VIA PULSA

    ReplyDelete
  10. AllAssignmenthelp reviews is best reviews site in US and Australia. We at Top Quality Assignment believe that there is no shortcut to success and to attain success, hard work, dedication, and commitment must be present.
    AllAssignmenthelp reviews
    All Assignment help reviews
    Assignment help reviews
    AllAssignmenthelp.com reviews

    ReplyDelete
  11. 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
  12. Packers and Movers Bangalore as a Services providing company can make all the difference to your ###Home Relocation experience. Bangalore based Company which offers versatile solutions, Right team that easily reduce the stress associated with a ✔✔✔Household Shifting, ***Vehicle Transportation. we help things run smoothly and reduce breakages and offer you seamless, Affordable, Reliable Shifting Services, Compare Shifting Charges. Packers And Movers Bangalore

    ReplyDelete
  13. Thank you for bestowing this information which will enlighten many of us. It’s really helpful for me and the one who wants to know more about mobile app development company.

    ReplyDelete
  14. Thank you for sharing this. The blog is very informative. The given blog tends to provide essential information about the changes and modifications of the Web application development company.

    ReplyDelete
  15. The post is very supportive as it helped me to solve numerous queries related to my assignment and I was so glad about the end result. I would recommend you guys to choose Assignment Help Australia for good grades.

    ReplyDelete
  16. you can go through AllAssignmentHelp.com reviews. It will help you to know about the services, and it will help you to know whether that site is reliable or not.

    ReplyDelete
  17. Hey, Your blog is very informative. It is nice to read such high-quality content. Attractive information on your blog, thank you for taking the time and share with us. Myassignmenthelp delivers quality content related to employee motivation assignment writer.

    ReplyDelete
  18. Pay for essay writing at MyAssignmenthelp and you will have enough time to take care of your personal tasks. Prepare for your online exams or take care of your family without any stress. Got a party to attend? Need a vacation to de-stress yourself? Well, congratulations, since you have found someone who will handle your essay writing tasks.
    Do you often look for college essay help online due to a massive time constraint? Do you often wish for a Genie who could complete all your essay papers in a snap? Well, Genies may not be real, but we have got the next best thing for you – professional college essay writers.

    ReplyDelete
  19. I love to visit your site repeatedly because; here I find all information is very useful and educational for me. online paper editor

    ReplyDelete
  20. Myassignmenthelp have earned the reputation of serving countless students across the globe who have secured excellent grades under our professional guidance. We have a dedicated team of PhD qualified essay writers who are competent enough to provide the best assignment help service, essays and write-ups for the students. Our assignment help company has benefitted customers throughout the world

    ReplyDelete
  21. Begini Cara Menghasilkan Uang dan Mengelola Uang Yang Baik Trik Menjadi Kaya

    ReplyDelete
  22. Agen Bola Sbobet 13win, merupakan agen bola yang menyediakan pendaftaran mudah dan pelayanan terbaik untuk permainan judi bola dari Sbobet yang terkenal dengan kemudahan serta keuntungan besar yang bisa anda dapatkan. untuk mengenal 13win yuk kunjungi profilenya satu ini
    https://www.wantedly.com/users/105872092/

    ReplyDelete
  23. Dapatkan Prediksi Bola Terlengkap Disini Pasar Taruhan
    Gabung Dengan Partner Bola Terbaik Agen Sbobet

    Hubungi kami Sekarang Juga :
    WA: +6287785425244
    LINE: WINNING303

    ReplyDelete

  24. Hey, your post is very informative to me. Thank you. You want your assignment to be correct and unique to your competitors but due to lack of time it can be delayed and you can lose your grades. You can get an online assignment help writing service from AB Assignment Help in the UK. Needs help? We are on 24/7 support.

    ReplyDelete
  25. At Singaporetranslators.com, we have a pool of language writers who have proved them the ACADEMIC TRANSLATION SERVICES SINGAPORE by providing uncountable service to the Singapore’s students. They are highly expertise and professionalism in writing any kind of assignment works.

    ReplyDelete
  26. Allessaywriter.com can provide you all the answers regarding who can "write my essay". In our service, we have some of the best essay typer who are professional in this field. We ensure a high quality work within the stipulated time. Not only that, but our prices are so reasonable that you do not have to peep into your pocket before hiring us.

    ReplyDelete
  27. One can expect to find websites such as My Assignment Help Review, Australianhelp review, edubirdie, essayshark review, Ukessays posted in the site, which are written by real students only after availing the services personally. We don’t entertain fake reviews and the one that are written without any prior confirmation. Our team of site admin works dedicatedly in order to make sure that each of the feedbacks that are posted is absolutely original, without any scope for fake contents and unethical attempts of defamation.

    ReplyDelete
  28. Thank you for bestowing this information which will enlighten many of us. It’s really helpful for me and the one who wants to know more about mobile application development company USA.

    ReplyDelete
  29. In case you are wondering, “I need someone to help me with my science homework” you must hire our services. Our team of 3000+ experts provides guidance with a wide variety of subjects and covers over 100+ areas of science. Most of our writers are PhD graduates and retired professors with years of experience in dealing with various fields of science subjects. Our experts on science homework helper online provide comprehensive solutions for the subjects listed below:

    ReplyDelete
  30. Livewebtutors aims at providing the students with a one stop solution for all the academic related issues. The company has Livewebtutors is an online Assignment Help and assignment writing service offering expert assignment help. Hire Australian assignment writing experts.
    visit now:- management assignment help

    ReplyDelete
  31. I love to visit your site repeatedly because; here I find all information is very useful and educational for me.we are Interior Designer in Delhi

    ReplyDelete
  32. Livewebtutors aims at providing the students with a one stop solution for all the academic related issues. The company has Livewebtutors is an online Assignment Help and assignment writing service offering expert assignment help. Hire Australian assignment writing experts.
    visit now:- CDR Report writing

    ReplyDelete
  33. What a brilliant information post its really wonder full article thanks for the sharing these great post Case Study Writing Services Australia.Case Study Assignment Help

    ReplyDelete
  34. Whole Night Package: In the whole night package, you can book the VIP Escorts in Delhi to give you the perfect satisfying experience for the entire night. Yes, they will be charging heftily for the comprehensive whole night package.

    ReplyDelete
  35. Students can easily get amazing accounting assignment help services from the professional experts of StudentsAssignmentHelp.com. We are having best team of experts have gained great knowledge in completing all your task accurately and in the asked format. So, students can easily get the best homework writing services today and score high grades.

    ReplyDelete
  36. Our website AllAssignmenthelp.com is affiliated with the site of various nations. We give our administration everywhere around the world. Our assignment assistance is given to students all through.
    Assignment Help Canada

    ReplyDelete
  37. Livewebtutors aims at providing the students with a one stop solution for all the academic related issues. The company has Livewebtutors is an online Assignment Help and assignment writing service offering expert assignment help. Hire Australian assignment writing experts.
    visit now:- Assignment Help

    ReplyDelete
  38. Thanks a lot for sharing. This amazing post and very informative.
    Homework Help Canada
    Law Assignment Help

    ReplyDelete
  39. Great! This has been an incredibly wonderful post. Many thanks for providing these details. Korean translators

    ReplyDelete
  40. Are you always struggling with assignment so now its time to remove all your stress about assignment help. SingaporeAssignmentHelp have expertise ghostwriter singapore and they are more capable to complete any project management assignment on time at nominal price for betterment of students.

    ReplyDelete
  41. My Assignment Services is no. 1 when it comes up to providing online assignment help. We have a team of expert writers who are qualified in every level of econometrics, from basic to advanced econometrics. Some of these tutors are still working in this field, so they are well aware of the latest trends and are able to describe them well. Each assignment that we deliver, undergoes proper editing & proofreading and plagiarism check, so that there are no errors. My Assignment Services will always be there standing tall 24x7. We provide help for a wide range of assignments and styles like, dissertation, report writing, essays, case study, etc. My Assignment Services is ready for Australian students rely on our assignment help UAE due to our amazing features like, plagiarism free content, after sales service, error free papers, etc. You don’t have to involve much, as we want you to relax and let our experts do the work for you. My Assignment Services has been serving students from past 11 years now and we have gained good name among students due to our excellent quality of work. My Assignment Services not only help with healthcare, but also other subjects like higher business management, economics, finance, computer science, biology, etc. If you also have any unfinished management assignments, then we are here to provide you the best management assignment help. Our quality is unbeatable and we provide plagiarism free content. No need to worry now, as you can avail our thesis writing service Australia with amazing discounts and cashbacks. There is no need to panik, as we are here to help. So, order now.

    ReplyDelete
  42. Our team is officialy working 24x7 to offer you best service. Our team is having amazing knowledge and they are offering you all the assignment service so you can get by simply visiting studentsassignmenthelp.com. One of the best and latest service you can get here. Stop who are demanding for stats homework help, it's they you can easily get on our website.

    ReplyDelete
  43. Get the assignment writing service and submit the project way before the date for a hassle-free end submission with quality work in it. You can check the content of writing we provide when you take assignment help Australia service from us, and surely you would get utmost satisfaction.

    ReplyDelete
  44. Your information is very detailed and useful to me, thank you for sharing. I hope you will always be up to date. We also provide affordable Law Assignment help in uk.

    ReplyDelete

  45. Common MLA citation generator style types along with examples of how they are laid. Start the Works Cited list on a new page at the end of your assignment. Harvard generator covers all basic explanations and examples for the most common types of citations used by students.

    Harvard reference generator

    ReplyDelete
  46. Thank you for sharing this informative post.MyAssignmenthelp.co.uk 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 Online project management Writers to save their time and make life easy.

    ReplyDelete
  47. Nice! Thanks for sharing this kind of information it’s really nice and thoughtful post. I’m waiting for your next post. If anyone students want CDR Help for college student then you have simply contact our expert team we have to provide best CDR writing help

    ReplyDelete
  48. Rajajudi14 Agen Judi Online yang terdapat banyak macam game hanya dengan satu usergame saja:

    - Judi bola
    - Live casino
    - Slots
    - Lotre
    - Poker
    - dan masi banyak lagi

    Menawarkan berbagai bonus menarik diantaranya:

    - Bonus New Member Sportbook dan Casino 20%
    - Bonus Next Deposit 5%
    - Bonus Cash Back 5%
    - Bonus Turnover Poker 0,5%

    Support Bank:
    - BCA
    - BNI
    - BRI
    - MANDIRI

    segera kunjungi kami di website kami Rajajudi14

    ReplyDelete

  49. Thank you for sharing this amazing post. Hope readers will like it.

    Cheeksandtoez
    Register at Cheeksandtoez

    ReplyDelete
  50. Assignments have become way more important than students understand. Assignments not only carry a lot of marks, but these are also important to gain knowledge as while writing assignments, you study a lot of other people’s work which can help you to understand topics clearly. However, many students seek Best assignment help from experts due to the many hurdles that they face while writing assignments.

    ReplyDelete
  51. My assignment help is a service you can opt for any kind of academic support like essay help, thesis writing, case study or dissertation writing. The format of all the papers you would get perfect and the content would be thoughtful and logical as per the topic.

    ReplyDelete