Hi All
On AEM 6.2 when I copy a page via the Page manager not all the properties on the are getting copied,
System user has full access to everything on my author instance, My user mapping is as below:
user mapping service
com.test.pw.test-pw-services:getResourceResolver=system-user
do I need more user mapping to copy across all properties?
//working but not all props are getting copied
Page sourcePage = resourceResolver.resolve(source).adaptTo(Page.class);
if(sourcePage != null){
pageManager.copy(sourcePage, newPath, null, true, true, true);
//I've even tried manually overwriting these settings but it still gets set as blank
Page newPage = resourceResolver.resolve(newPath).adaptTo(Page.class);
if(newPage.hasContent()){
Node newpageJCRNode = newPage.resourceResolver.adaptTo(Node.class);
newpageJCRNode.setProperty("pageTitle", title);
Thanks
Eric
Solved! Go to Solution.
Views
Replies
Total Likes
For Service Mapping
<bundleId>:<subServiceName> = <systemUserName>
com.test.pw.test-pw-services:getResourceResolver=system-user
As i am seeing your subServiceName is getResourceResolver that seems like a method name, could you please give specific name of the service that will be the best practice and can use for various purpose like readService or writeService
Could you try of getting session in this way and check it works or not .
session = repository.loginService("subServiceName ", null);
Views
Replies
Total Likes
Hi Eric,
For the copy of the page please check source and destination path.Check with different path.
In second scenerio did you save the session like this Session.save();
Views
Replies
Total Likes
Hi
Yes, the page copy itself is working as the paths for both source and destination is correct.
it's wrapped in a try and catch with session.save() applied at the base of the try.
session.save();
session.refresh(true);
the issue im facing is not all the props are getting copied across
Views
Replies
Total Likes
For Service Mapping
<bundleId>:<subServiceName> = <systemUserName>
com.test.pw.test-pw-services:getResourceResolver=system-user
As i am seeing your subServiceName is getResourceResolver that seems like a method name, could you please give specific name of the service that will be the best practice and can use for various purpose like readService or writeService
Could you try of getting session in this way and check it works or not .
session = repository.loginService("subServiceName ", null);
Views
Replies
Total Likes