Hi there,
Please see following code to copy a node:
Node src = session.getRootNode().getNode("content/geometrixx-outdoors/en/men/coats/edmonton-winter/jcr:content"); Node dstParent = session.getRootNode().getNode("content/geometrixx-outdoors/fr/men/coats/edmonton-winter"); JcrUtil.copy(src, dstParent, "jcr:content"); session.save(); session.logout();
But the result seems the des-page lack of anything, please see following:
This is source page:
[img]copy.png[/img]
This is des-page:
[img]copy2.png[/img]
So why happened that? and how to deal with it? Anyone could help see it? Thanks a lot in advance.
Best regards,
Brian
Solved! Go to Solution.
Views
Replies
Total Likes
Hey Brian,
when I again re-looked at them, I think it might be because of this
You are copying from 'en' to 'fr' and
Header missing:
under 'fr' you dont have the nodes for 'women','equipment' and others which are there in 'en' and once you copy them aswell it should appear in the header
Footer missing:
There will be pages 'About us', 'Privacy Policy' and others in 'en' which might be again missing in 'fr'. Once you have them in 'fr' it should come over.
Views
Replies
Total Likes
Hi Brian,
The mismatch parts as per your screenshot belongs to the templates. So check if your destination page/node uses the same template as that of the source page/node.
Thanks,
bsloki
Views
Replies
Total Likes
hi bsloki,
I just use this JCR API to copy a node to another path. As per your point out something, how do you think to deal with it if need to use the same template as that of the source page/node?
Thanks a lot.
Brian
Views
Replies
Total Likes
Hey Brian,
when I again re-looked at them, I think it might be because of this
You are copying from 'en' to 'fr' and
Header missing:
under 'fr' you dont have the nodes for 'women','equipment' and others which are there in 'en' and once you copy them aswell it should appear in the header
Footer missing:
There will be pages 'About us', 'Privacy Policy' and others in 'en' which might be again missing in 'fr'. Once you have them in 'fr' it should come over.
Views
Replies
Total Likes
Hi bsloki,
You are good and i catch your meaning.Thank you so much.
Brian
Views
Replies
Total Likes
It seems that you are using JcrUtil to copy a node. Node copy just copies a node not a page. I believe you need to use PageManager API to copy page.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies