Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Is there way to know nodes without jcr:content node?

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

09-12-2016

Hi All,

Is there any way/tool to know the JCR nodes without jcr:content?

Please help me!!!

Thanks,

Kishore

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,157 likes

Total Posts

6,247 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile

Avatar
Establish
Community Manager
kautuk_sahni
Community Manager

Likes

1,157 likes

Total Posts

6,247 posts

Correct Reply

1,144 solutions
Top badges earned
Establish
Coach
Originator
Contributor 2
Contributor
View profile
kautuk_sahni
Community Manager

12-12-2016

Hi 

Please have a look at these posts:- 

Link:-http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manage...

// How to find nodes without specific child node? How can I find nodes without specific child node (e.g. jcr:content)?

 

Link:- http://stackoverflow.com/questions/25019693/cq-5-query-builder-to-get-list-of-pages-without-jcrconte...

// to get list of pages without jcr:content node

 

I hope this would help you.

~kautuk

Answers (13)

Answers (13)

Avatar

Avatar
Boost 5
Level 2
lucian_nicolaescu
Level 2

Likes

8 likes

Total Posts

7 posts

Correct Reply

3 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Boost 5
Level 2
lucian_nicolaescu
Level 2

Likes

8 likes

Total Posts

7 posts

Correct Reply

3 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
lucian_nicolaescu
Level 2

02-02-2021

You could use the groovy console (http://localhost:4502/groovyconsole) with a simple script like:

final query = session.workspace.queryManager.createQuery("SELECT * FROM [cq:Page] AS page WHERE ISDESCENDANTNODE(page, '/content/yoursite')", "JCR-SQL2")
final results = query.execute()
results.nodes.each{ node ->
    if (!node.hasNode("jcr:content")) {
        println node.path + " is missing the jcr:content node"
    }
}

 As you can see, this only searches for pages but can be changed or extended to work for dam:Asset depending on your use-case.

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,345 likes

Total Posts

3,220 posts

Correct Reply

914 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,345 likes

Total Posts

3,220 posts

Correct Reply

914 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

08-06-2018

Hi,

nodename doesn't support operation features only property does. So it won't work.

In this case you need to write your own predicate like Child to achieve this

OR you can create a servlet which traverse through path and find out all the Childs without jcr:content using Node API, and if you wish you can delete those nodes right away inside Servlet.

Thanks

Arun

Avatar

Avatar
Validate 1
Level 1
velp58307525
Level 1

Likes

3 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 1
velp58307525
Level 1

Likes

3 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
velp58307525
Level 1

07-06-2018

Hi ,

        I Had tried with this Query as well.

type=dam:Assest

path=/content/dam

nodename=jcr:content

node.operation=not

p.limit=-1

But Still I am getting the list of pages which has jcr:content in it. My ultimate aim is to skip the jcr:content  from search results is there any way to that ?

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,345 likes

Total Posts

3,220 posts

Correct Reply

914 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,345 likes

Total Posts

3,220 posts

Correct Reply

914 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

07-06-2018

HI,

I above query child is a custom predicate , you have to create that before using. same is mentioned in Link also.

but If you want to check specific node with name you can use nodename like below:

path=/content/dam

type=dam:Assest

nodename=jcr:content

p.limit=-1

Avatar

Avatar
Validate 1
Level 1
velp58307525
Level 1

Likes

3 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 1
velp58307525
Level 1

Likes

3 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
velp58307525
Level 1

07-06-2018

Please help me on this.

Avatar

Avatar
Validate 1
Level 1
velp58307525
Level 1

Likes

3 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 1
velp58307525
Level 1

Likes

3 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
velp58307525
Level 1

07-06-2018

Hi Kautukashni,

I had tried with the below mentioned link but it is not working.

Link:- http://stackoverflow.com/questions/25019693/cq-5-query-builder-to-get-list-of-pages-withou t-jcrcontent-node

// to get list of pages without jcr:content node

And my requirment was to remove the jcr:content from the Dam Assets, Please find my Query below.

Jcr Query :

path=/content/dam

type=dam:Assest

child.name=jcr:content
child.operator=not_exists
p.limit=-1

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

10-12-2016

I have seen it.

Wants to know if there are still any such nodes without jcr:content node in our application.

Looking for a way to know these kind of nodes.

-Kishore

Avatar

Avatar
Validate 1
Level 2
Veena_Vikraman
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Veena_Vikraman
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Veena_Vikraman
Level 2

09-12-2016

Are you seeing jcr:content nodes missing for your pages and assets ?

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

09-12-2016

smacdonald2008 wrote...

Is this specific to under a path like /content/<yoursite>? 

Or are you looking at this across the entire JCR structure? 

 

Looking for entire JCR structure.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

09-12-2016

Is this specific to under a path like /content/<yoursite>? 

Or are you looking at this across the entire JCR structure? 

Avatar

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile

Avatar
Validate 100
Level 6
GK-AEM
Level 6

Likes

40 likes

Total Posts

482 posts

Correct Reply

32 solutions
Top badges earned
Validate 100
Validate 50
Validate 25
Validate 10
Validate 1
View profile
GK-AEM
Level 6

09-12-2016

Recently we have upgraded application from AEM 6.0  to AEM 6.2.

We see some of the nodes without jcr:content node.

Would like to know if there is any way to know the nodes without any jcr:content.

Thanks,

Kishore

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

09-12-2016

Please provide more details. 

Avatar

Avatar
Validate 1
Employee
Opkar_Gill
Employee

Likes

138 likes

Total Posts

952 posts

Correct Reply

280 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Employee
Opkar_Gill
Employee

Likes

138 likes

Total Posts

952 posts

Correct Reply

280 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Opkar_Gill
Employee

09-12-2016

Not sure I understand the question, what are you trying to achieve, why do you want to do this?

Regards,

Opkar