Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

exporting annotations

Avatar

Level 1

hello. is it possible to export annotations from pages in AEM? and if so, how?

 

to keep track of comments, we'd like to include them in a table or spreadsheet. so far, it is possible to manually click on each annotation to copy and paste the comments into Excel. however, this is time consuming especially for files with more than 50 annotations.

 

thanks in advance for any thoughts or guidance on a more automated method.

 

kindest regards,

baz

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

The annotation saved in the page tree, a speacial node cq:annotations contains all the annotations, you can simply query this node using querybuilder and get only text or whichever property you want in a json format and convert into csv using simple javascript.  



Arun Patidar

View solution in original post

7 Replies

Avatar

Correct answer by
Community Advisor

Hi,

The annotation saved in the page tree, a speacial node cq:annotations contains all the annotations, you can simply query this node using querybuilder and get only text or whichever property you want in a json format and convert into csv using simple javascript.  



Arun Patidar

Avatar

Level 1
Hi Arun. Thank you for your response. I found the node, but I'm having trouble querying it. We have CRXDE Lite. I'm getting the following message when running a simple query (select * from nt:base where jcr:path like '/content/...%') from nt:base >> "The query read or traversed more than 100000 nodes. To avoid affecting other tasks, processing was stopped." Would you be able to recommend a good reference to learn more about this environment and how to interrogate it with query builder? NB: I'm a front-end user so I'm unsure if that's also part of the problem!

Avatar

Community Advisor
try with below query SELECT child.* FROM [cq:PageContent] AS parent INNER JOIN [nt:unstructured] AS child ON ISDESCENDANTNODE(child,parent) WHERE ISDESCENDANTNODE(parent, '/content/myProj') AND name(child) = "cq:annotations"


Arun Patidar

Avatar

Level 1
ah.. ok. thanks. that worked. now I see the path in my results. would you mind pointing me to the relevant table(s) with the annotation text? happy to read thru any reference material freely available (c: and if I was to list out all the tables, is there a generic name to use for the database name?

Avatar

Community Advisor

the annotations saved under cq:annotations node as a child node, the properties are text and x,y to get details.

Screenshot 2021-02-08 at 15.11.58.png

 



Arun Patidar

Avatar

Level 1
Yay... I see it now. Thanks very much for all your help!

Avatar

Level 1
Hi Arun. Hoping to pick your brain again as I didn't get very far with your last tip. I tried running the following query thinking I'd be able to see the text property values: SELECT child.*, ann.* FROM [nt:unstructured] AS child INNER JOIN [nt:unstructured] AS ann ON ISDESCENDANTNODE(ann,child) WHERE ISDESCENDANTNODE(child, '/content/...') AND name(child) = "cq:annotations" but instead, I am still only seeing PATH in the results pane of CRXDE Lite. I suspect this is my limited understanding of the UI. Now that I have the query which I think is what I need... how do I see the actual results with the text property values from the children of cq:annotations nodes?