Created attachment 703533 [details] A simple maven project to build a reproducer. It's needed to add the corresponding JPP JARS to build it. Description of problem: In the PageManagement service, when I clone a page to a different destination, I received an exception: "Could not clone page " + dst.name + "to existing page " + dst.site.getType() + " with id " + dst.site.getName()); I have a look at the implementation, I find a typo mistake on line 273 of class org.exoplatform.portal.mop.page.PageServiceImpl: org.gatein.mop.api.workspace.Page dstRoot = srcSite.getRootPage(); It should be : org.gatein.mop.api.workspace.Page dstRoot = dstSite.getRootPage(); How reproducible: See attached portlet. The following code should reproduce it: ExoContainer exo = ExoContainerContext.getCurrentContainer(); PageService pageService = ((PageService) exo .getComponentInstanceOfType(PageService.class)); SiteKey siteKey = new SiteKey(SiteType.GROUP, "/platform/users"); PageKey pageKey = new PageKey(siteKey, "NewClonedPage"); PageKey srcPage = new PageKey(siteKey, "homepage"); pageService.clone(srcPage, pageKey); Steps to Reproduce: 1. Download the attached portlet and set the classpath to include JPP artifacts as well; 2. Build it and deploy to JPP; 3. Register the portlet in "Application Registry"; 4. Create a new page and add then portlet to it. Access the page; Actual results: An exception is thrown saying the page doesn't exist. Expected results: It should clone the page. Additional info: It happens when we attempt to clone the page from another location (see the code above). It tries to clone the page
Looks like this has been fixed upstream already according to JIRA. Needs verification
The reproducer portlet has the following error: SiteKey siteKey = new SiteKey(SiteType.GROUP, "/platform/users"); should be replaced by: SiteKey siteKey = new SiteKey(SiteType.PORTAL, "classic"); otherwise the portlet fails to find the src page.
Created attachment 744777 [details] Reproducer portlet Attaching a fixed version of the reproducer. The key is to create a cloned page with the same name, but in a different destination folder: SiteKey srcSiteKey = new SiteKey(SiteType.PORTAL, "classic"); PageKey srcPage = new PageKey(srcSiteKey, "homepage"); // destination SiteKey dstSiteKey = new SiteKey(SiteType.GROUP, "/platform/users"); pageService.clone(srcPage, dstSiteKey.page(srcPage.getName())); output = "Page " + srcPage + " cloned with success to " + dstSiteKey; Note that you can only successfully invoke the portlet once.
Verified using above reproducer (ER3).