[gatein-commits] gatein SVN: r4766 - in portal/trunk: portlet/dashboard/src/main/webapp/groovy/gadget/webui/component and 22 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Oct 22 07:45:26 EDT 2010


Author: trong.tran
Date: 2010-10-22 07:45:25 -0400 (Fri, 22 Oct 2010)
New Revision: 4766

Added:
   portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml
Modified:
   portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
   portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetViewMode.gtmpl
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
   portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
   portal/trunk/server/tomcat/patch/src/main/tomcat/conf/server.xml
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
   portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl
   portal/trunk/web/rest/src/main/webapp/WEB-INF/web.xml
   portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
   portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
   portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
   portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/WebuiBindingContext.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-1537 Merge the works from branch into trunk

Modified: portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
===================================================================
--- portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -75,6 +75,14 @@
             {
                return GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
             }
+            else 
+            {
+            	if (log.isWarnEnabled())
+            	{
+            	   log.warn("The local gadget '" + gadgetName + "' was not found, nothing rendered");
+            	}
+            	return null;
+            }
          }
          catch (Exception e)
          {
@@ -94,6 +102,11 @@
          uiApplication.addMessage(new ApplicationMessage("UIGadgetPortlet.msg.url-invalid", null));
       }
 
+      return getMetadata(url);
+   }
+   
+   public String getMetadata(String url)
+   {
       String metadata_ = GadgetUtil.fetchGagdetMetadata(url);
       try
       {

Modified: portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetViewMode.gtmpl
===================================================================
--- portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetViewMode.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/dashboard/src/main/webapp/groovy/gadget/webui/component/UIGadgetViewMode.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -5,19 +5,23 @@
 	import org.exoplatform.webui.application.portlet.PortletRequestContext;
 	
 	def hostName = GadgetUtil.getRelGadgetServerUrl();
-  def rcontext = _ctx.getRequestContext() ;
-  def windowId = rcontext.getWindowId();
-  def id = uicomponent.getId() + "-" + windowId ;
-  def url = uicomponent.getParent().getUrl();
-  def metadata = uicomponent.getParent().getMetadata();
-  def userPref = null;//uicomponent.getUserPref() ;
-  JavascriptManager jsmanager = rcontext.getJavascriptManager();
-	jsmanager.importJavascript("eXo.gadget.UIGadget") ;
-	jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','$id', $metadata, $userPref, 'canvas', '$hostName');") ;
-	java.util.Map<String, String> metadataMap = GadgetUtil.getMapMetadata(url) ;
-	String height = "auto" ;
-	if(metadataMap.containsKey("height")  && Integer.parseInt(metadataMap.get("height")) > 0) 
-		height = (Integer.parseInt(metadataMap.get("height")) + 10) + "px" ;
+	def rcontext = _ctx.getRequestContext() ;
+	def windowId = rcontext.getWindowId();
+	def id = uicomponent.getId() + "-" + windowId ;
+	def url = uicomponent.getParent().getUrl();
+	def height = "auto" ;
+	
+	if(url != null) {
+  	def metadata = uicomponent.getParent().getMetadata(url);
+  	def userPref = null;
+  	JavascriptManager jsmanager = rcontext.getJavascriptManager();
+  	jsmanager.importJavascript("eXo.gadget.UIGadget") ;
+  	jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','$id', $metadata, $userPref, 'canvas', '$hostName');") ;
+  	java.util.Map<String, String> metadataMap = GadgetUtil.getMapMetadata(url) ;
+	
+  	if(metadataMap.containsKey("height")  && Integer.parseInt(metadataMap.get("height")) > 0) 
+  		height = (Integer.parseInt(metadataMap.get("height")) + 10) + "px" ;
+  }
 %>
 
 <div class="UIGadgetViewMode" id="$id" style="height: <%=height%>;"></div>

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -20,6 +20,7 @@
 package org.exoplatform.applicationregistry.webui.component;
 
 import org.exoplatform.application.registry.Application;
+import org.exoplatform.application.registry.ApplicationCategory;
 import org.exoplatform.application.registry.ApplicationRegistryService;
 import org.exoplatform.web.application.ApplicationMessage;
 import org.exoplatform.webui.application.WebuiRequestContext;
@@ -95,7 +96,9 @@
       service.update(application_);
       Application selectedApplication = getApplication();
       UIApplicationOrganizer uiApplicationOrganizer = getAncestorOfType(UIApplicationOrganizer.class);
+      ApplicationCategory selectedCategory = uiApplicationOrganizer.getSelectedCategory();
       uiApplicationOrganizer.reload();
+      uiApplicationOrganizer.setSelectedCategory(selectedCategory);
       uiApplicationOrganizer.setSelectedApplication(selectedApplication);
    }
 

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -110,26 +110,23 @@
       WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
       UIApplication uiApp = context.getUIApplication();
       String username = getUIStringInput(USERNAME).getValue();
-      User user = service.getUserHandler().findUserByName(username);
-      String oldEmail = user.getEmail();
+      User user = service.getUserHandler().findUserByName(username);      
       if (user == null)
       {
          uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.user-is-deleted", null, ApplicationMessage.WARNING));
          UIUserInfo userInfo = getParent();
          if (userInfo != null)
          {
-            UIUserManagement userManagement = userInfo.getParent();
-            UIListUsers listUser = userManagement.getChild(UIListUsers.class);
             UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
             UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
             userInfo.setRenderSibling(UIListUsers.class);
-            listUser.search(new Query());
             accountInput.reset();
             userProfile.reset();
             context.setProcessRender(true);
          }
          return false;
       }
+      String oldEmail = user.getEmail();
       invokeSetBindingField(user);
       if (isChangePassword())
       {

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIListUsers.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -91,7 +91,6 @@
       grid_.configure(USER_NAME, USER_BEAN_FIELD, USER_ACTION);
       grid_.getUIPageIterator().setId("UIListUsersIterator");
       grid_.getUIPageIterator().setParent(this);
-      search(new Query());
    }
 
    /**
@@ -117,18 +116,12 @@
    public String getUserSelected()
    {
       return userSelected_;
-   }
+   }      
 
    public void search(Query query) throws Exception
    {
       lastQuery_ = query;
-      grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));
-      UIPageIterator pageIterator = grid_.getUIPageIterator();
-      if (pageIterator.getAvailable() == 0)
-      {
-         UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
-         uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
-      }
+      grid_.getUIPageIterator().setPageList(new FindUsersPageList(query, 10));      
    }
 
    public void quickSearch(UIFormInputSet quickSearchInput) throws Exception
@@ -137,29 +130,33 @@
       UIFormStringInput input = (UIFormStringInput)quickSearchInput.getChild(0);
       UIFormSelectBox select = (UIFormSelectBox)quickSearchInput.getChild(1);
       String name = input.getValue();
-      if (name == null || name.equals(""))
+      if (name != null && !name.equals(""))
       {
-         search(new Query());
-         return;
-      }
-      if (name.indexOf("*") < 0)
+         if (name.indexOf("*") < 0)
+         {
+            if (name.charAt(0) != '*')
+               name = "*" + name;
+            if (name.charAt(name.length() - 1) != '*')
+               name += "*";
+         }
+         name = name.replace('?', '_');
+         String selectBoxValue = select.getValue();
+         if (selectBoxValue.equals(USER_NAME))
+            query.setUserName(name);
+         if (selectBoxValue.equals(LAST_NAME))
+            query.setLastName(name);
+         if (selectBoxValue.equals(FIRST_NAME))
+            query.setFirstName(name);
+         if (selectBoxValue.equals(EMAIL))
+            query.setEmail(name);                 
+      }      
+      search(query);
+      
+      if (getChild(UIGrid.class).getUIPageIterator().getAvailable() == 0)
       {
-         if (name.charAt(0) != '*')
-            name = "*" + name;
-         if (name.charAt(name.length() - 1) != '*')
-            name += "*";
+         UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
+         uiApp.addMessage(new ApplicationMessage("UISearchForm.msg.empty", null));
       }
-      name = name.replace('?', '_');
-      String selectBoxValue = select.getValue();
-      if (selectBoxValue.equals(USER_NAME))
-         query.setUserName(name);
-      if (selectBoxValue.equals(LAST_NAME))
-         query.setLastName(name);
-      if (selectBoxValue.equals(FIRST_NAME))
-         query.setFirstName(name);
-      if (selectBoxValue.equals(EMAIL))
-         query.setEmail(name);
-      search(query);
    }
 
    @SuppressWarnings("unused")
@@ -176,7 +173,9 @@
          OrganizationService service = uiListUsers.getApplicationComponent(OrganizationService.class);
          if (service.getUserHandler().findUserByName(username) == null)
          {
-            uiListUsers.search(new Query());
+            UIApplication uiApplication = event.getRequestContext().getUIApplication();
+            uiApplication.addMessage(new ApplicationMessage("UIListUsers.msg.user-is-deleted", 
+               null, ApplicationMessage.WARNING));
             return;
          }
          uiListUsers.setRendered(false);

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIOrganizationPortlet.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -70,8 +70,10 @@
    {
       public void execute(Event<UIOrganizationPortlet> event) throws Exception
       {
-         UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
-         uiListUsers.search(new Query());
+         //Actually we don't need to do anything here 
+         //UIListUsers will have the lasteast data in it's processRender method
+//         UIListUsers uiListUsers = event.getSource().findFirstComponentOfType(UIListUsers.class);
+//         uiListUsers.search(new Query());
       }
    }
 }
\ No newline at end of file

Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -143,12 +143,9 @@
             Util.getPortalRequestContext().setFullRender(true);
          }
          
-         UIUserManagement userManagement = uiUserInfo.getParent();
-         UIListUsers listUser = userManagement.getChild(UIListUsers.class);
          UIAccountEditInputSet accountInput = uiUserInfo.getChild(UIAccountEditInputSet.class);
          UIUserProfileInputSet userProfile = uiUserInfo.getChild(UIUserProfileInputSet.class);
          uiUserInfo.setRenderSibling(UIListUsers.class);
-         listUser.search(new Query());
          accountInput.reset();
          userProfile.reset();
          event.getRequestContext().setProcessRender(true);
@@ -160,12 +157,9 @@
       public void execute(Event<UIUserInfo> event) throws Exception
       {
          UIUserInfo userInfo = event.getSource();
-         UIUserManagement userManagement = userInfo.getParent();
-         UIListUsers listUser = userManagement.getChild(UIListUsers.class);
          UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
          UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
          userInfo.setRenderSibling(UIListUsers.class);
-         listUser.search(new Query());
          accountInput.reset();
          userProfile.reset();
          event.getRequestContext().setProcessRender(true);

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.properties	2010-10-22 11:45:25 UTC (rev 4766)
@@ -79,7 +79,8 @@
 UIListUsers.label.option.lastName=#{word.lastName}
 UIListUsers.label.option.email=#{word.email}
 UIListUsers.msg.DeleteSuperUser={0} is Super User, it can not be deleted
-UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.deleteUser=Are you sure you want to delete {0} user?
+UIListUsers.msg.user-is-deleted=This user may be deleted.
 
 UIListMembershipType.deleteMemberShip=Are you sure you want to delete this membership?
 

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml	2010-10-22 11:45:25 UTC (rev 4766)
@@ -79,6 +79,9 @@
          <short-title>Account Portlet</short-title>
          <keywords>Administration</keywords>
       </portlet-info>
+      <supported-publishing-event>
+      	<name>NewAccountAdded</name>
+      </supported-publishing-event>
    </portlet>
 
    <portlet>

Copied: portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml (from rev 4763, portal/branches/branch-GTNPORTAL-1537/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml)
===================================================================
--- portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml	                        (rev 0)
+++ portal/trunk/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml	2010-10-22 11:45:25 UTC (rev 4766)
@@ -0,0 +1,168 @@
+<Server>
+
+   <!-- Optional listener which ensures correct init and shutdown of APR,
+        and provides information if it is not installed -->
+   <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+   <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+   <Listener className="org.apache.catalina.core.JasperListener" />
+
+   <Service name="jboss.web">
+
+      <!-- A HTTP/1.1 Connector on port 8080 -->
+      <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}" 
+               connectionTimeout="20000" redirectPort="8443" />
+
+      <!-- Add this option to the connector to avoid problems with 
+          .NET clients that don't implement HTTP/1.1 correctly 
+         restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
+      -->
+
+      <!-- A AJP 1.3 Connector on port 8009 -->
+      <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
+         redirectPort="8443" />
+
+      <!-- SSL/TLS Connector configuration using the admin devl guide keystore
+      <Connector protocol="HTTP/1.1" SSLEnabled="true" 
+           port="8443" address="${jboss.bind.address}"
+           scheme="https" secure="true" clientAuth="false" 
+           keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
+           keystorePass="rmi+ssl" sslProtocol = "TLS" />
+      -->
+
+      <Engine name="jboss.web" defaultHost="localhost">
+
+         <!-- The JAAS based authentication and authorization realm implementation
+         that is compatible with the jboss 3.2.x realm implementation.
+         - certificatePrincipal : the class name of the
+         org.jboss.security.auth.certs.CertificatePrincipal impl
+         used for mapping X509[] cert chains to a Princpal.
+         - allRolesMode : how to handle an auth-constraint with a role-name=*,
+         one of strict, authOnly, strictAuthOnly
+           + strict = Use the strict servlet spec interpretation which requires
+           that the user have one of the web-app/security-role/role-name
+           + authOnly = Allow any authenticated user
+           + strictAuthOnly = Allow any authenticated user only if there are no
+           web-app/security-roles
+         -->
+         <Realm className="org.jboss.web.tomcat.security.JBossWebRealm"
+            certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+            allRolesMode="authOnly"
+            />
+         <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+         behavior of JBossSecurityMgrRealm, but overrides the authorization
+         checks to use JACC permissions with the current java.security.Policy
+         to determine authorized access.
+         - allRolesMode : how to handle an auth-constraint with a role-name=*,
+         one of strict, authOnly, strictAuthOnly
+           + strict = Use the strict servlet spec interpretation which requires
+           that the user have one of the web-app/security-role/role-name
+           + authOnly = Allow any authenticated user
+           + strictAuthOnly = Allow any authenticated user only if there are no
+           web-app/security-roles
+         <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+            certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+            allRolesMode="authOnly"
+            />
+         -->
+
+         <Host name="localhost"> 
+
+            <!-- Uncomment to enable request dumper. This Valve "logs interesting 
+                 contents from the specified Request (before processing) and the 
+                 corresponding Response (after processing). It is especially useful 
+                 in debugging problems related to headers and cookies."
+            -->
+            <!--
+            <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+            -->
+ 
+            <!-- Access logger -->
+            <!--
+            <Valve className="org.apache.catalina.valves.AccessLogValve"
+                prefix="localhost_access_log." suffix=".log"
+                pattern="common" directory="${jboss.server.log.dir}" 
+                resolveHosts="false" />
+            -->
+
+            <!-- Uncomment to enable single sign-on across web apps
+                deployed to this host. Does not provide SSO across a cluster.     
+            
+                If this valve is used, do not use the JBoss ClusteredSingleSignOn 
+                valve shown below.
+                
+                A new configuration attribute is available beginning with
+                release 4.0.4:
+                
+                cookieDomain  configures the domain to which the SSO cookie
+                              will be scoped (i.e. the set of hosts to
+                              which the cookie will be presented).  By default
+                              the cookie is scoped to "/", meaning the host
+                              that presented it.  Set cookieDomain to a
+                              wider domain (e.g. "xyz.com") to allow an SSO
+                              to span more than one hostname.
+             -->
+
+            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
+
+            <!-- Uncomment to enable single sign-on across web apps
+               deployed to this host AND to all other hosts in the cluster.
+            
+               If this valve is used, do not use the standard Tomcat SingleSignOn
+               valve shown above.
+            
+               Valve uses a JBossCache instance to support SSO credential 
+               caching and replication across the cluster.  The JBossCache 
+               instance must be configured separately.  See the 
+               "jboss-web-clusteredsso-beans.xml" file in the 
+               server/all/deploy directory for cache configuration details.
+            
+               Besides the attributes supported by the standard Tomcat
+               SingleSignOn valve (see the Tomcat docs), this version also 
+               supports the following attributes:
+            
+               cookieDomain   see non-clustered valve above
+               
+               cacheConfig    Name of the CacheManager service configuration
+                              to use for the clustered SSO cache. See
+                              deploy/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml
+                              Default is "clustered-sso".
+               
+               treeCacheName  Deprecated. Use "cacheConfig". 
+                              JMX ObjectName of the JBoss Cache MBean used to 
+                              support credential caching and replication across
+                              the cluster. Only used if no cache can be located
+                              from the CacheManager service using the "cacheConfig"
+                              attribute (or its default value). If not set, the 
+                              default is "jboss.cache:service=TomcatClusteringCache"
+                              
+               maxEmptyLife   The maximum number of seconds an SSO with no 
+                              active sessions will be usable by a request
+                              
+               processExpiresInterval The minimum number of seconds between 
+                              efforts by the valve to find and invalidate 
+                              SSO's that have exceeded their 'maxEmptyLife'. 
+                              Does not imply effort will be spent on such
+                      			cleanup every 'processExpiresInterval'.
+            -->
+            <!--
+            <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+            -->
+         
+            <!-- Check for unclosed connections and transaction terminated checks
+                 in servlets/jsps.
+                 
+                 Important: The dependency on the CachedConnectionManager
+                 in META-INF/jboss-service.xml must be uncommented, too
+           -->
+
+            <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
+                cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
+                transactionManagerObjectName="jboss:service=TransactionManager" />
+                
+         </Host>
+      </Engine>
+
+   </Service>
+
+</Server>

Modified: portal/trunk/server/tomcat/patch/src/main/tomcat/conf/server.xml
===================================================================
--- portal/trunk/server/tomcat/patch/src/main/tomcat/conf/server.xml	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/server/tomcat/patch/src/main/tomcat/conf/server.xml	2010-10-22 11:45:25 UTC (rev 4766)
@@ -121,9 +121,7 @@
 
         <!-- SingleSignOn valve, share authentication between web applications
              Documentation at: /docs/config/valve.html -->
-        <!--
         <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-        -->
 
         <!-- Access log processes all example.
              Documentation at: /docs/config/valve.html -->

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -674,11 +674,9 @@
             el.type = "checkbox";
             el.name = prefix + att;
             el.id = elID;
-            if (userPrefs[att] && userPrefs[att] == "true") {
-                el.checked = userPrefs[att];
-            } else {
-            	if(prefs[att].default == "true")
-            		el.checked = true;
+            if ((userPrefs[att] && userPrefs[att] == "true") ||
+            		prefs[att]["default"] == "true") {
+                el.checked = true;
             }
             attEl.appendChild(el);
         }

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -244,7 +244,7 @@
         href += "&op=MinimizeGadget";
         href += "&minimized=" + minimized;
         href += "&objectId=" + uiGadget.id + "&ajaxRequest=true";
-        ajaxAsyncGetRequest(href);
+        ajaxGet(href);
         if (uiGadget.minimizeCallback) uiGadget.minimizeCallback(portletFrag.parentNode.id);
     },
     /**
@@ -294,7 +294,7 @@
                 
                 var uiDashboardCont = DOMUtil.findAncestorByClass(uiGadget, "UIDashboardContainer"); 
                 if(uiDashboardCont) {
-                	ajaxAsyncGetRequest(href);
+                	ajaxGet(href);
 	                DOMUtil.removeElement(uiGadget);
 	                if(!DOMUtil.findFirstDescendantByClass(uiDashboardCont, "div", "UIGadget")) {
 	                	DOMUtil.findFirstDescendantByClass(uiDashboardCont, "div", "NoGadget").style.display = "block";

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -196,6 +196,38 @@
 
   DragDrop.dropCallback = function(dndEvent) {
   	this.origDragObjectStyle.setProperties(dndEvent.dragObject.style, false) ;
+  	
+  	var hasChanged = true;
+  	//When press esc key, we want to cancel the dragdrop, but now it only works with FF
+  	if (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode == 27 && eXo.core.Browser.isFF()) {
+  		hasChanged = false;
+  	}
+  	//When dragObject is outside 
+		var targetElement = dndEvent.foundTargetObject;  
+		if(!targetElement || targetElement.foundIndex == null) {
+			hasChanged = false;
+		}
+		//When dragobject is next to preview object (position is not changed)
+  	if(!dndEvent.dragObject.isAddingNewly) {
+	  	var DOMUtil = eXo.core.DOMUtil;
+	  	var previewClass = "DragAndDropPreview";
+	  	var previewTagName = "div";
+	  	var previewSibling = dndEvent.dragObject;
+	  	if (dndEvent.dragObject.parentNode.tagName.toLowerCase() == "td") {
+	  		previewSibling = dndEvent.dragObject.parentNode; 		
+	  		previewClass = "PreviewTDBlock";
+	  		previewTagName = "td";
+	  	}
+	  	var tempObj = DOMUtil.findNextElementByTagName(previewSibling, previewTagName);
+	  	if (tempObj != null && tempObj.className == previewClass) {
+	    	hasChanged = false;
+	    } else {
+	    	tempObj = DOMUtil.findPreviousElementByTagName(previewSibling, previewTagName);
+		    if (tempObj != null && tempObj.className == previewClass) {
+		    	hasChanged = false;
+		    }
+	    }
+  	}
 
     if(dndEvent.foundTargetObject != null || (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode != 27)) {
     	eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
@@ -219,7 +251,9 @@
     previewBlock = previewTD = null;
     
     eXo.portal.isInDragging = false;
-  	eXo.portal.UIPortal.changeComposerSaveButton();
+    if (hasChanged) {
+    	eXo.portal.UIPortal.changeComposerSaveButton();
+    }
 		// fix bug WEBOS-196	
 		dndEvent.dragObject.style.width = "auto" ; 
   };

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalHttpRequest.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -515,7 +515,7 @@
 	      }
 	    }
 	  }
-	  if(response.blocksToUpdate == undefined) {
+	  if(response.blocksToUpdate == undefined && temp.innerHTML !== "") {
 	  	if(confirm(eXo.i18n.I18NMessage.getMessage("SessionTimeout"))) instance.ajaxTimeout(request) ;
 	  }
 	  //Handle the portal responses

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortalNavigation.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -223,8 +223,8 @@
       eXo.portal.UIPortalNavigation.superClass.setPosition(menuItemContainer, x, y, eXo.core.I18n.isRT());
       eXo.portal.UIPortalNavigation.superClass.show(menuItemContainer);
       
-      menuItemContainer.style.width = menuItemContainer.offsetWidth - parseInt(DOMUtil.getStyle(menuItemContainer, "borderLeftWidth")) 
-          - parseInt(DOMUtil.getStyle(menuItemContainer, "borderRightWidth")) + "px";
+      menuItemContainer.style.width = menuItemContainer.offsetWidth - parseInt(DOMUtil.getStyle(menuItemContainer, "borderLeftWidth",true)) 
+          - parseInt(DOMUtil.getStyle(menuItemContainer, "borderRightWidth",true)) + "px";
 			var posXinBrowser = eXo.core.Browser.findPosX(menuItemContainer);
 			if(eXo.core.I18n.isLT()) {
 				if(posXinBrowser + menuItemContainer.offsetWidth >= eXo.core.Browser.getBrowserWidth()) {

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UICalendar.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -68,7 +68,7 @@
 }
 
 UICalendar.prototype.show = function() {
-	document.onmousedown = new Function('eXo.webui.UICalendar.hide()') ;
+	document.onclick = new Function('eXo.webui.UICalendar.hide()') ;
 	var re = /^(\d{1,2}\/\d{1,2}\/\d{1,4})\s*(\s+\d{1,2}:\d{1,2}:\d{1,2})?$/i ;
   this.selectedDate = new Date() ;
 
@@ -150,35 +150,27 @@
     clndr.firstChild.style.top = -heightCal.offsetHeight + 'px';
   }
 	
-	var drag = document.getElementById("BlockCaledar");
-	var component =  eXo.core.DOMUtil.findAncestorByClass(drag, "UICalendarComponent");
-	var calendar = eXo.core.DOMUtil.findFirstChildByClass(drag, "div", "UICalendar");
-	var innerWidth = drag.offsetWidth;
-	drag.onmousedown = function(evt) {
-		var event = evt || window.event;
-		event.cancelBubble = true;
-		drag.style.position = "absolute";
-		if(eXo.core.Browser.isIE7()) drag.style.height = calendar.offsetHeight + "px";
-		drag.style.width = innerWidth + "px";
-		eXo.core.DragDrop.init(null, drag, component, event);
- 	}
-	
-	//
-	var primary = eXo.core.DOMUtil.findAncestorById(this.dateField, "UIECMSearch");
-	if (primary && eXo.core.Browser.isFF()) {
-			calendar = clndr.firstChild;
-			calendar.style.top = "0px";
-			calendar.style.left = this.dateField.offsetLeft - this.dateField.offsetWidth - 32 + "px";
-	}
+  eXo.webui.UICalendar.initDragDrop();
+  
+  var drag = document.getElementById("BlockCaledar");
+  var calendar = eXo.core.DOMUtil.findFirstChildByClass(drag, "div", "UICalendar");		
+  var primary = eXo.core.DOMUtil.findAncestorById(this.dateField, "UIECMSearch");
+  if (primary && eXo.core.Browser.isFF()) {
+	calendar = clndr.firstChild;
+	calendar.style.top = "0px";
+	calendar.style.left = this.dateField.offsetLeft - this.dateField.offsetWidth - 32 + "px";
+  }
 }
 
 UICalendar.prototype.hide = function() {
   if (this.dateField) {
     document.getElementById(this.calendarId).firstChild.style.display = 'none' ;
 //		this.dateField.parentNode.style.position = '' ;
+    this.dateField.blur();
     this.dateField = null ;
   }
- 	document.onmousedown = null ;
+  document.onclick = null ;
+  //document.onmousedown = null;
 }
 
 /* TODO: Move HTML code to a javascript template file (.jstmpl) */
@@ -188,7 +180,7 @@
   var startDayOfWeek = this.getDayOfWeek(this.currentDate.getFullYear(), this.currentDate.getMonth() + 1, dayOfMonth) ;
   var daysInMonth = this.getDaysInMonth(this.currentDate.getFullYear(), this.currentDate.getMonth()) ;
   var clazz = null;
-	var table = '<div id="BlockCaledar" class="BlockCalendar">' ;
+	var table = '<div id="BlockCaledar" class="BlockCalendar" onclick="event.cancelBubble = true">' ;
 	table += 		'<div class="UICalendar" onmousedown="event.cancelBubble = true">' ;
 	table += 		'	<table class="MonthYearBox">' ;
 	table += 		'	  <tr>' ;
@@ -258,13 +250,41 @@
 	this.currentDate.setMonth(this.currentDate.getMonth() + change) ;
   var clndr = document.getElementById(this.calendarId) ;
   clndr.firstChild.lastChild.innerHTML = this.renderCalendar() ;
+  
+  eXo.webui.UICalendar.initDragDrop();
 }
 
+UICalendar.prototype.initDragDrop = function() {
+	  var drag = document.getElementById("BlockCaledar");
+	  var component =  eXo.core.DOMUtil.findAncestorByClass(drag, "UICalendarComponent");
+	  var calendar = eXo.core.DOMUtil.findFirstChildByClass(drag, "div", "UICalendar");
+	  var innerWidth = drag.offsetWidth;
+	  
+	  eXo.core.DragDrop2.init(drag, component);	  
+	  component.onDragStart = function() {
+		  if(eXo.core.Browser.isIE7()) drag.style.height = calendar.offsetHeight + "px";
+		  drag.style.width = innerWidth + "px";
+	  }
+	  
+//	  var calendar = eXo.core.DOMUtil.findFirstChildByClass(drag, "div", "UICalendar");
+//	  var innerWidth = drag.offsetWidth;
+//	  drag.onmousedown = function(evt) {
+//		  var event = evt || window.event;
+//		  event.cancelBubble = true;
+//		  drag.style.position = "absolute";
+//		  if(eXo.core.Browser.isIE7()) drag.style.height = calendar.offsetHeight + "px";
+//		  drag.style.width = innerWidth + "px";
+//		  eXo.core.DragDrop2.init(drag, component);		  
+//	  }
+}
+
 UICalendar.prototype.changeYear = function(change) {
   this.currentDate.setFullYear(this.currentDate.getFullYear() + change) ;
   this.currentDay = 0 ;
   var clndr = document.getElementById(this.calendarId) ;
   clndr.firstChild.lastChild.innerHTML = this.renderCalendar() ;
+  
+  eXo.webui.UICalendar.initDragDrop();
 }
 
 UICalendar.prototype.setDate = function(year, month, day) {	

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIDashboard.js	2010-10-22 11:45:25 UTC (rev 4766)
@@ -233,7 +233,7 @@
 							{name: "objectId", value: dragObj.id}
 						];
 						var url = uiDashboardUtil.createRequest(compId, 'MoveGadget', params);
-						ajaxAsyncGetRequest(url);
+						ajaxGet(url);
 					}
 				}
 			}
@@ -255,7 +255,7 @@
 	};
 	
 	UIDashboard.prototype.onLoad = function(windowId, canEdit) {
-		var portletWindow = document.getElementById(windowId);
+		var portletWindow = document.getElementById(windowId) ? document.getElementById(windowId) : document.getElementById("UIPortlet-" + windowId);
 		if(!portletWindow) return;
 		
 		var DOMUtil = eXo.core.DOMUtil;

Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties	2010-10-22 11:45:25 UTC (rev 4766)
@@ -1249,6 +1249,7 @@
 UIDashboard.msg.addGadget=Drag your gadgets here.
 UIDashboard.msg.notUrl=The url is invalid. Please enter a correct url of a gadget xml or of an RSS feed.
 UIDashboard.msg.ApplicationNotExisted=This application is not exist or may be deleted.
+UIDashboard.msg.StaleData=Some stale data are on your dashboard, it will be refreshed now
 
   ################################################################################
   #		 org.exoplatform.webui.organization.account.UIUserSelector

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -39,8 +39,10 @@
 					<div class="<%=isMini ? "RestoreGadget": "MinimizeGadget";%> MinimizeAction IconControl" 
 									onclick="eXo.gadget.UIGadget.minimizeGadget(this)" onmousedown="event.cancelBubble=true;" style="display:none;" 
 									title="<%=isMini ? unminiTitle : miniTitle%>" miniTitle="$miniTitle" unminiTitle="$unminiTitle"><span></span></div>
-					<div class="EditGadget IconControl" onclick="eXo.gadget.UIGadget.editGadget('$id')" onmousedown="event.cancelBubble=true;" title="<%=_ctx.appRes("UIGadget.tooltip.editGadget")%>"><span></span></div>
-					<div class="GadgetDragHandleArea"><span></span></div>
+					<% if(uicomponent.isSettingUserPref()) { %>
+                       <div class="EditGadget IconControl" onclick="eXo.gadget.UIGadget.editGadget('$id')" onmousedown="event.cancelBubble=true;" title="<%=_ctx.appRes("UIGadget.tooltip.editGadget")%>"><span></span></div>
+					<% } %>
+                    <div class="GadgetDragHandleArea"><span></span></div>
 					<div class="GadgetTitle" style="display: none; float: none; width: auto; margin-right: 75px"><%= uicomponent.getApplicationName() %></div>
 				</div>
 			</div>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -286,7 +286,7 @@
 															%>
 															<div class="PortletIcon $portletIcon"><%=hasPermission ? title : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 															<%if(hasPermission) {%>
-																<a href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditPortletPropertiesIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
+																<a href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;" class="EditPortletPropertiesIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
 																<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeletePortletIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.deletePortlet");%>"></a>
 															<%}%>
 														</div>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -42,9 +42,9 @@
 				<div class="VIEW-CONTAINER VIEW-BLOCK">
 			<%} %> 
 					<%if(hasPermission) {%>
-						<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
-							<div>
-								<%uicomponent.renderChildren();%>
+					    <div>
+							<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">							
+									<%uicomponent.renderChildren();%>							
 							</div>
 						</div>
 						<%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
@@ -72,7 +72,7 @@
 														%>
 														<div class="ContainerIcon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -73,7 +73,7 @@
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -73,7 +73,7 @@
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -70,7 +70,7 @@
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
 															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -52,7 +52,7 @@
 						<tr>
 							<td>
 								
-								<div onclick="<%= uicomponent.event("ViewProperties") %>;eXo.portal.UIPortal.changeComposerSaveButton()" class="ActionButton SimpleStyle1">
+								<div onclick="<%= uicomponent.event("ViewProperties") %>;" class="ActionButton SimpleStyle1">
 									<div class="ButtonLeft">
 										<div class="ButtonRight">
 											<div class="ButtonMiddle">

Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl	2010-10-22 11:45:25 UTC (rev 4766)
@@ -17,7 +17,7 @@
 %>
 <div class="UITrees ScrollArea">
 	<div class="TreeContainer JSContainer">
-		<div style="padding-bottom: 12px">
+		<div style="padding-bottom: 12px; width: 99%">
 			<div class="HomeNode">
 				<a class="LevelUpArrowIcon" href="<%=uicomponent.getActionLink();%>" onmousedown="event.cancelBubble=true;" title="<%=_ctx.appRes("UITree.tooltip.UpLevel")%>" style="display: block;"><span></span></a>
 			</div>

Modified: portal/trunk/web/rest/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/web/rest/src/main/webapp/WEB-INF/web.xml	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/web/rest/src/main/webapp/WEB-INF/web.xml	2010-10-22 11:45:25 UTC (rev 4766)
@@ -56,7 +56,17 @@
     <filter-name>RestEncodingFilter</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>
-      
+  
+  <!-- ================================================================== -->
+  <!--           LISTENER                                                 -->
+  <!-- ================================================================== -->
+  <listener>
+	<listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
+  </listener>
+  <listener>
+    <listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
+  </listener>    
+    
   <servlet>
     <servlet-name>RestServer</servlet-name>
     <description>eXo - Platform REST Server</description>
@@ -74,6 +84,10 @@
     <url-pattern>/*</url-pattern>
   </servlet-mapping>
 
+	<session-config>
+	  <session-timeout>30</session-timeout> 
+	</session-config>
+	
   <security-constraint>
     <web-resource-collection>
       <web-resource-name>rest</web-resource-name>

Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -234,6 +234,6 @@
          w.write(value_.toString());
          w.write('\'');
       }
-      w.write(" onmousedown='event.cancelBubble = true' />");
+      w.write(" onclick='event.cancelBubble = true'/>");
    }
 }

Modified: portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java
===================================================================
--- portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboard.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -31,7 +31,9 @@
 import org.exoplatform.webui.config.annotation.ComponentConfigs;
 import org.exoplatform.webui.config.annotation.EventConfig;
 import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIPopupMessages;
 import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.UIPortletApplication;
 import org.exoplatform.webui.event.Event;
 import org.exoplatform.webui.event.EventListener;
 
@@ -62,6 +64,26 @@
       addChild(UIDashboardContainer.class, null, null);
    }
 
+   @Override
+   public void processRender(WebuiRequestContext context) throws Exception
+   {
+      UIGadget uiGadget = this.getMaximizedGadget();      
+      if (uiGadget != null) 
+      {         
+         UIPopupMessages uiPopupMessages = getAncestorOfType(UIPortletApplication.class).getUIPopupMessages();
+         for (ApplicationMessage msg : uiPopupMessages.getErrors())
+         {
+            if (msg.getMessageKey().equals("UIDashboard.msg.ApplicationNotExisted"))
+            {
+               this.setMaximizedGadget(null);
+               break;
+            }
+         }         
+      }
+      
+      super.processRender(context);
+   }
+
    public void setColumns(int num) throws Exception
    {
       getChild(UIDashboardContainer.class).setColumns(num);
@@ -152,9 +174,13 @@
          else
          {
             uiGadget.getProperties().setProperty("minimized", minimized);
+            uiDashboardCont.save();
+            if (uiDashboard.getAncestorOfType(UIPortletApplication.class).getUIPopupMessages().hasMessage())
+            {
+               return;
+            }
+            Util.getPortalRequestContext().setResponseComplete(true);
          }
-         uiDashboardCont.save();
-         context.addUIComponentToUpdateByAjax(uiGadget);
       }
    }
 
@@ -178,13 +204,16 @@
             context.addUIComponentToUpdateByAjax(uiDashboard);
             return;
          }
-         
-         //TODO nguyenanhkien2a at gmail.com
-         //We need to expand unminimized state of uiGadget to view all body of gadget, not just a title with no content
+
+         // TODO nguyenanhkien2a at gmail.comá
+         // We need to expand unminimized state of uiGadget to view all body of
+         // gadget, not just a title with no content
          uiGadget.getProperties().setProperty("minimized", "false");
          uiDashboardCont.save();
-         
-         if (maximize.equals("maximize"))
+
+         UIPortletApplication uiDashboarPortlet = uiDashboard.getAncestorOfType(UIPortletApplication.class);
+         if (maximize.equals("maximize")
+            && !uiDashboarPortlet.getUIPopupMessages().hasMessage())
          {
             uiGadget.setView(UIGadget.CANVAS_VIEW);
             uiDashboard.setMaximizedGadget(uiGadget);

Modified: portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java
===================================================================
--- portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/dashboard/src/main/java/org/exoplatform/dashboard/webui/component/UIDashboardContainer.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -22,6 +22,7 @@
 import org.exoplatform.application.registry.Application;
 import org.exoplatform.application.registry.ApplicationRegistryService;
 import org.exoplatform.portal.config.DataStorage;
+import org.exoplatform.portal.config.StaleModelException;
 import org.exoplatform.portal.config.model.Container;
 import org.exoplatform.portal.config.model.Dashboard;
 import org.exoplatform.portal.config.model.TransientApplicationState;
@@ -30,6 +31,7 @@
 import org.exoplatform.portal.webui.application.UIPortlet;
 import org.exoplatform.portal.webui.container.UIContainer;
 import org.exoplatform.portal.webui.util.PortalDataMapper;
+import org.exoplatform.portal.webui.util.Util;
 import org.exoplatform.web.application.ApplicationMessage;
 import org.exoplatform.web.application.RequestContext;
 import org.exoplatform.webui.application.WebuiRequestContext;
@@ -40,6 +42,8 @@
 import org.exoplatform.webui.config.annotation.ParamConfig;
 import org.exoplatform.webui.core.UIApplication;
 import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.UIPopupMessages;
+import org.exoplatform.webui.core.UIPortletApplication;
 import org.exoplatform.webui.core.model.SelectItemOption;
 import org.exoplatform.webui.event.Event;
 import org.exoplatform.webui.event.EventListener;
@@ -47,6 +51,8 @@
 import org.jibx.runtime.IBindingFactory;
 import org.jibx.runtime.IUnmarshallingContext;
 
+import com.sun.mail.imap.protocol.UIDSet;
+
 import java.io.ByteArrayInputStream;
 import java.util.ArrayList;
 import java.util.List;
@@ -148,7 +154,7 @@
          uiRoot.getChildren().clear();
 
          // Assemble the dashboard
-         PortalDataMapper.toUIContainer(uiRoot, dashboard);
+         PortalDataMapper.toUIContainer(uiRoot, dashboard);         
       }
 
       //
@@ -478,7 +484,15 @@
          DataStorage service = getApplicationComponent(DataStorage.class);
 
          // Save
-         service.saveDashboard(dashboard);
+         try
+         {
+            service.saveDashboard(dashboard);
+         }
+         catch (StaleModelException e)
+         {
+            getAncestorOfType(UIPortletApplication.class).addMessage(
+               new ApplicationMessage("UIDashboard.msg.StaleData", null, ApplicationMessage.ERROR));            
+         }
       }
    }
 
@@ -532,7 +546,11 @@
 
          uiDashboardContainer.moveUIGadget(objectId, col, row);
          uiDashboardContainer.save();
-         event.getRequestContext().setResponseComplete(true);
+         if (uiDashboard.getAncestorOfType(UIPortletApplication.class).getUIPopupMessages().hasMessage()) 
+         {
+            return;
+         }
+         Util.getPortalRequestContext().setResponseComplete(true);
       }
    }
 
@@ -552,15 +570,18 @@
          UIDashboardContainer uiDashboardContainer = uiDashboard.getChild(UIDashboardContainer.class);
          uiDashboardContainer.removeUIGadget(objectId);
          boolean isMaximized = false;
-         if (uiDashboard.getMaximizedGadget() != null && uiDashboard.getMaximizedGadget().getId().equals(objectId))
+         if (uiDashboard.getMaximizedGadget() != null && 
+                  uiDashboard.getMaximizedGadget().getId().equals(objectId))
          {
             uiDashboard.setMaximizedGadget(null);
             isMaximized = true;
          }
          uiDashboardContainer.save();
-         if (!isMaximized)
+         UIPopupMessages uiPopupMessages = 
+            uiDashboard.getAncestorOfType(UIPortletApplication.class).getUIPopupMessages();
+         if (!isMaximized && !uiPopupMessages.hasMessage())
          {
-            context.setResponseComplete(true);
+            Util.getPortalRequestContext().setResponseComplete(true);
          }
       }
    }

Modified: portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/WebuiBindingContext.java
===================================================================
--- portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/WebuiBindingContext.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/core/lifecycle/WebuiBindingContext.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -89,7 +89,7 @@
 
    public String appRes(String mesgKey) throws Exception
    {
-      String value;
+      String value = "";
       try
       {
          ResourceBundle res = rcontext_.getApplicationResourceBundle();
@@ -99,7 +99,8 @@
       {
          if (PropertyManager.isDevelopping())
             log.warn("Can not find resource bundle for key : " + mesgKey);
-         value = mesgKey.substring(mesgKey.lastIndexOf('.') + 1);
+         if(mesgKey != null)
+            value = mesgKey.substring(mesgKey.lastIndexOf('.') + 1);
       }
       return value;
    }

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -38,6 +38,7 @@
 import org.exoplatform.webui.event.Event;
 import org.exoplatform.webui.event.EventListener;
 import org.exoplatform.webui.exception.MessageException;
+import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -88,6 +89,16 @@
    public static final String HOME_VIEW = "home";
 
    public static final String CANVAS_VIEW = "canvas"; 
+   
+   public static final String METADATA_GADGETS = "gadgets";
+   
+   public static final String METADATA_USERPREFS = "userPrefs";
+   
+   public static final String METADATA_USERPREFS_TYPE = "type";
+   
+   public static final String METADATA_USERPREFS_TYPE_HIDDEN = "hidden";
+   
+   public static final String METADATA_USERPREFS_TYPE_LIST = "list";
 
    public String view = HOME_VIEW;
 
@@ -205,7 +216,7 @@
             String strMetadata = GadgetUtil.fetchGagdetMetadata(getUrl());
             metadata_ = new JSONObject(strMetadata);
          }
-         JSONObject obj = metadata_.getJSONArray("gadgets").getJSONObject(0);
+         JSONObject obj = metadata_.getJSONArray(METADATA_GADGETS).getJSONObject(0);
          String token = GadgetUtil.createToken(this.getUrl(), new Random().nextLong());
          obj.put("secureToken", token);
          return metadata_.toString();
@@ -215,6 +226,39 @@
          return null;
       }
    }
+   /**
+    * Check if content of gadget has <UserPref>? (Content is parsed from gadget specification in .xml file)
+    * @return boolean
+    */
+   public boolean isSettingUserPref()
+   {
+      try
+      {
+         if(metadata_ != null)
+         {
+            JSONObject obj = metadata_.getJSONArray(METADATA_GADGETS).getJSONObject(0);
+            JSONObject userPrefs = obj.getJSONObject(METADATA_USERPREFS);
+            JSONArray names = userPrefs.names();
+            int count = names.length();
+            if(count > 0)
+            {
+               for(int i = 0; i < count; i++)
+               {
+                  JSONObject o = (JSONObject) userPrefs.get(names.get(i).toString());
+                  if(!(o.get(METADATA_USERPREFS_TYPE).equals(METADATA_USERPREFS_TYPE_HIDDEN) || 
+                        o.get(METADATA_USERPREFS_TYPE).equals(METADATA_USERPREFS_TYPE_LIST)))
+                     return true;
+               }
+               return false;
+            }
+         }
+         return false;
+      }
+      catch (Exception e)
+      {
+         return false;
+      }
+   }
 
    @Override
    public boolean isRendered()
@@ -379,10 +423,13 @@
          WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
          
          //
-         try{
+         try
+         {
             uiGadget.addUserPref(event.getRequestContext().getRequestParameter("userPref"));
-            Util.getPortalRequestContext().setFullRender(true);
-         } catch(Exception e){            
+            Util.getPortalRequestContext().setResponseComplete(true);
+         } 
+         catch(Exception e)
+         {                        
             UIPortletApplication uiPortlet = uiGadget.getAncestorOfType(UIPortletApplication.class);
             context.addUIComponentToUpdateByAjax(uiPortlet);
             throw new MessageException(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null, ApplicationMessage.ERROR));

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletForm.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -402,6 +402,7 @@
          }
 
          PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
+         pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
          pcontext.addUIComponentToUpdateByAjax(uiMaskWorkspace);
          UIPortalApplication uiPortalApp = uiPortlet.getAncestorOfType(UIPortalApplication.class);
          UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -143,6 +143,7 @@
 
          UIPortalApplication uiPortalApp = uiForm.getAncestorOfType(UIPortalApplication.class);
          UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+         pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
          pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
          pcontext.setFullRender(true);
          Util.showComponentLayoutMode(UIContainer.class);

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -280,7 +280,7 @@
          PortalRequestContext pcontext = Util.getPortalRequestContext();
          UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
          uiMaskWS.setUIComponent(null);
-         uiMaskWS.setShow(false);
+         uiMaskWS.setShow(false);         
          pcontext.addUIComponentToUpdateByAjax(uiMaskWS);
 
          UIPage uiPage = uiPageForm.getUIPage();
@@ -318,7 +318,7 @@
             pcontext.setFullRender(true);
             UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
             pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
-
+            pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
             return;
          }
 
@@ -337,6 +337,7 @@
             pcontext.setFullRender(true);
             UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
             pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
+            pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
             DataStorage dataService = uiPageForm.getApplicationComponent(DataStorage.class);
             dataService.save(page);
             return;
@@ -360,6 +361,7 @@
 
          try{
             PortalDataMapper.toUIPage(uiPage, page);
+            pcontext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
          } catch(NoSuchDataException de){
             uiPortalApp.addMessage(new ApplicationMessage("UIPageForm.msg.notExistOrDeleted", null, ApplicationMessage.ERROR));
             UIPortalComposer uiPortalComposer = (UIPortalComposer)uiPortalApp.findComponentById("UIPageEditor");

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageNodeForm.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -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)

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java	2010-10-22 10:27:10 UTC (rev 4765)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java	2010-10-22 11:45:25 UTC (rev 4766)
@@ -337,7 +337,12 @@
 
          UIMaskWorkspace uiMaskWorkspace = uiForm.getParent();
          uiMaskWorkspace.setUIComponent(null);
-         event.getRequestContext().addUIComponentToUpdateByAjax(uiMaskWorkspace);
+         WebuiRequestContext rContext = event.getRequestContext();
+         if (!uiForm.getId().equals("CreatePortal")) 
+         {
+            rContext.getJavascriptManager().addJavascript("eXo.portal.UIPortal.changeComposerSaveButton();");
+         }         
+         rContext.addUIComponentToUpdateByAjax(uiMaskWorkspace);
       }
    }
 



More information about the gatein-commits mailing list