[
https://jira.jboss.org/browse/GTNPORTAL-1288?page=com.atlassian.jira.plug...
]
Minh Hoang TO commented on GTNPORTAL-1288:
------------------------------------------
As i mentioned in earlier comments, there are order-related in recursive method
saveChildren from class Mapper.
// Delete removed children
for (Iterator<UIComponent> i = dst.getComponents().iterator(); i.hasNext();)
{
UIComponent dstChild = i.next();
String dstChildId = dstChild.getObjectId();
if (!modelObjectMap.containsKey(dstChildId))
{
i.remove();
changes.add(new ModelChange.Destroy(dstChildId));
}
}
The statement i.remove() in above code snippet would remove the Node specified by ID
dstChildId from the workspace ( that is what we don't expect in case we permute the
UIComponent but do not destroy them). Hence, the consequent recursive calls would fail if
the object having storageId dstChildId is required.
My idea to fix this issue is to make an overall 'clean' outside the method
saveChildren. For each recursive call in saveChildren, a ModelChange.Destroy is registered
like below.
// Delete removed children
for (Iterator<UIComponent> i = dst.getComponents().iterator(); i.hasNext();)
{
UIComponent dstChild = i.next();
String dstChildId = dstChild.getObjectId();
if (!modelObjectMap.containsKey(dstChildId))
{
//i.remove();
//changes.add(new ModelChange.Destroy(dstChildId));
changes.add(new ModelChange.Destroy(dst.getObjectId(), dstChildId));
}
}
the layout edition does not work correctly if drag a portlet out of a
container
-------------------------------------------------------------------------------
Key: GTNPORTAL-1288
URL:
https://jira.jboss.org/browse/GTNPORTAL-1288
Project: GateIn Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 3.1.0-CR01
Reporter: Trong Tran
Assignee: Minh Hoang TO
Fix For: 3.1.0-GA
Attachments: dragLayout.diff, exception.txt
Original Estimate: 4 hours
Remaining Estimate: 4 hours
Assume that the current page/site layout has a portlet A inner a container B. Then
- we go to edit the page/site layout
- drag the portlet A out of the container B
- CLick on Save button :
+ In page layout edition, there will a java.lang.ClassCastException exception (
attached exception.txt file )
+ In site layout edition, Save successfully but the portlet A will be removed
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira