활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi Community,
I have written this basic code to access jcr:content properties of my current page specifically cq:tags property but it is not working.
public Void activate throws exception{
rootpage=getCurrentPage;
Resource res = getResourceResolver.getResource(rootpage.getPath);
ValueMap pageProperties = res .getValueMap();
tag= (String) properties.get("cq:tags", "Default value");
}
When I'm using getter method to access the cq:tags property it is showing only Default Value and not the real value of cq:tags even though I can see cq:tags property inside jcr:content in pages.
Please help.
Is there any other way of achieving the same task?
해결되었습니다! 솔루션으로 이동.
조회 수
답글
좋아요 수
Hi @ShagunMalik ,
It is because "rootpage.getPath" is just path to a page (for example /content/mywebsite/en/mypage) and it is not ending with "jcr:content" node, whereas the properties you are looking for are stored on jcr:content node. So you have to add jcr:content before making resource ((for example /content/mywebsite/en/mypage/jcr:content) ).
Resource res = getResourceResolver.getResource(rootpage.getPath + "/jcr:content/");
The best way is to enable debugger in your favorite IDE (eclipse for example) and inspect on run time. That way you will find it more easy while development.
hope it helps!
Hi @ShagunMalik ,
It is because "rootpage.getPath" is just path to a page (for example /content/mywebsite/en/mypage) and it is not ending with "jcr:content" node, whereas the properties you are looking for are stored on jcr:content node. So you have to add jcr:content before making resource ((for example /content/mywebsite/en/mypage/jcr:content) ).
Resource res = getResourceResolver.getResource(rootpage.getPath + "/jcr:content/");
The best way is to enable debugger in your favorite IDE (eclipse for example) and inspect on run time. That way you will find it more easy while development.
hope it helps!
Hey @Ritesh_Mittal I'm getting logger to debug and when I see Error logs I found error "AEM failed to activate Use class". How to resolve it?
I have made the changes that you suggested.
조회 수
답글
좋아요 수
@ShagunMalik , So you are good with your original issue, right? and for the error logs, its better if you create a new issue/thread so that tracking will be easy.
조회 수
답글
좋아요 수
조회 수
답글
좋아요 수
Hi @ShagunMalik
There are multiple things you need to validate here:
Thanks
Dipti
Hi @ShagunMalik,
Please check the below link , this might help.
Solved: WCMUsePojo in AEM6.3 not working - Adobe Experience League Community - 277245
Thanks