Bug 916260 - Unable to clone page (PageService) in a different destination
Summary: Unable to clone page (PageService) in a different destination
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Portal Platform 6
Classification: JBoss
Component: Portal
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER03
: 6.1.0
Assignee: Default User
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-02-27 16:29 UTC by William Antônio
Modified: 2018-12-01 16:51 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-11-07 14:21:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
A simple maven project to build a reproducer. It's needed to add the corresponding JPP JARS to build it. (25.48 KB, application/zip)
2013-02-27 16:29 UTC, William Antônio
no flags Details
Reproducer portlet (7.16 KB, application/zip)
2013-05-07 14:47 UTC, Martin Weiler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GTNPORTAL-2820 0 Major Resolved Unable to clone page (PageService) in a different destination 2014-01-05 07:18:43 UTC

Description William Antônio 2013-02-27 16:29:58 UTC
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

Comment 1 Boleslaw Dawidowicz 2013-04-17 07:34:30 UTC
Looks like this has been fixed upstream already according to JIRA. Needs verification

Comment 2 Martin Weiler 2013-05-07 13:33:14 UTC
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.

Comment 3 Martin Weiler 2013-05-07 14:47:37 UTC
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.

Comment 5 Dominik Pospisil 2013-08-01 12:26:51 UTC
Verified using above reproducer (ER3).


Note You need to log in before you can comment on or make changes to this bug.