[gatein-commits] gatein SVN: r4668 - portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Oct 14 05:48:31 EDT 2010


Author: ndkhoiits
Date: 2010-10-14 05:48:30 -0400 (Thu, 14 Oct 2010)
New Revision: 4668

Modified:
   portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java
Log:
GTNPORTAL-1561 Don't get the information from PUBLICATION_DATE after edit a SYSTEM node

Modified: portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java	2010-10-14 09:40:28 UTC (rev 4667)
+++ portal/branches/branch-GTNPORTAL-1537/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java	2010-10-14 09:48:30 UTC (rev 4668)
@@ -186,13 +186,16 @@
    public void invokeSetBindingBean(Object bean) throws Exception
    {
       super.invokeSetBindingBean(bean);
-      PageNode node = (PageNode)bean;
-      Calendar cal = getUIFormDateTimeInput(START_PUBLICATION_DATE).getCalendar();
-      Date date = (cal != null) ? cal.getTime() : null;
-      node.setStartPublicationDate(date);
-      cal = getUIFormDateTimeInput(END_PUBLICATION_DATE).getCalendar();
-      date = (cal != null) ? cal.getTime() : null;
-      node.setEndPublicationDate(date);
+      PageNode node = (PageNode) bean;
+      if (node.getVisibility() != Visibility.SYSTEM)
+      {
+         Calendar cal = getUIFormDateTimeInput(START_PUBLICATION_DATE).getCalendar();
+         Date date = (cal != null) ? cal.getTime() : null;
+         node.setStartPublicationDate(date);
+         cal = getUIFormDateTimeInput(END_PUBLICATION_DATE).getCalendar();
+         date = (cal != null) ? cal.getTime() : null;
+         node.setEndPublicationDate(date);
+      }
    }
 
    public void setShowCheckPublicationDate(boolean show)
@@ -269,7 +272,11 @@
          WebuiRequestContext ctx = event.getRequestContext();
          UIPageNodeForm uiPageNodeForm = event.getSource();
          UIApplication uiPortalApp = ctx.getUIApplication();
-         if (uiPageNodeForm.getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE).isChecked())
+         PageNode pageNode = uiPageNodeForm.getPageNode();
+         if (pageNode == null)
+            pageNode = new PageNode();
+         
+         if (pageNode.getVisibility() != Visibility.SYSTEM && uiPageNodeForm.getUIFormCheckBoxInput(SHOW_PUBLICATION_DATE).isChecked())
          {
             Calendar currentCalendar = Calendar.getInstance();
             currentCalendar.set(currentCalendar.get(Calendar.YEAR), currentCalendar.get(Calendar.MONTH), currentCalendar.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
@@ -305,10 +312,7 @@
             }
             
          }
-
-         PageNode pageNode = uiPageNodeForm.getPageNode();
-         if (pageNode == null)
-            pageNode = new PageNode();
+         
          uiPageNodeForm.invokeSetBindingBean(pageNode);
          UIPageSelector2 pageSelector = uiPageNodeForm.getChild(UIPageSelector2.class);
          if (pageSelector.getPage() == null)



More information about the gatein-commits mailing list