Author: ndkhoiits
Date: 2011-05-25 04:48:22 -0400 (Wed, 25 May 2011)
New Revision: 6556
Modified:
portal/branches/branch-GTNPORTAL-1872/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java
Log:
GTNPORTAL-1652 New page for node is created even if it is canceled
Modified:
portal/branches/branch-GTNPORTAL-1872/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java
===================================================================
---
portal/branches/branch-GTNPORTAL-1872/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java 2011-05-25
08:38:59 UTC (rev 6555)
+++
portal/branches/branch-GTNPORTAL-1872/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java 2011-05-25
08:48:22 UTC (rev 6556)
@@ -68,10 +68,6 @@
private PageNode pageNode_;
- private String owner_;
-
- private String ownerType_;
-
private Object selectedParent;
/**
@@ -313,10 +309,23 @@
}
- uiPageNodeForm.invokeSetBindingBean(pageNode);
UIPageSelector2 pageSelector = uiPageNodeForm.getChild(UIPageSelector2.class);
if (pageSelector.getPage() == null)
- pageNode.setPageReference(null);
+ {
+ pageSelector.setValue(null);
+ }
+ else
+ {
+ Page page = pageSelector.getPage();
+ DataStorage storage =
uiPageNodeForm.getApplicationComponent(DataStorage.class);
+ if (storage.getPage(page.getPageId()) == null)
+ {
+ storage.create(page);
+ pageSelector.setValue(page.getPageId());
+ }
+ }
+
+ uiPageNodeForm.invokeSetBindingBean(pageNode);
UIFormInputIconSelector uiIconSelector =
uiPageNodeForm.getChild(UIFormInputIconSelector.class);
if (uiIconSelector.getSelectedIcon().equals("Default"))
pageNode.setIcon(null);
@@ -499,9 +508,7 @@
return;
}
- // save page to database
- dataService.create(page);
- pageSelector.setValue(page.getPageId());
+ pageSelector.setPage(page);
}
}
}