[gatein-commits] gatein SVN: r5502 - in portal/trunk: component/application-registry/src/test/java/org/exoplatform/application/gadget and 40 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Dec 7 22:37:33 EST 2010


Author: hoang_to
Date: 2010-12-07 22:37:31 -0500 (Tue, 07 Dec 2010)
New Revision: 5502

Added:
   portal/trunk/component/resources/src/test/resources/locale/portlet_en.properties
   portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/RedefinableResourceFilter.java
   portal/trunk/webui/portal/src/test/
   portal/trunk/webui/portal/src/test/java/
   portal/trunk/webui/portal/src/test/java/org/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java
   portal/trunk/webui/portal/src/test/resources/
   portal/trunk/webui/portal/src/test/resources/conf/
   portal/trunk/webui/portal/src/test/resources/conf/portal/
   portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml
   portal/trunk/webui/portal/src/test/resources/webui-configuration.xml
Removed:
   portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java
   portal/trunk/webui/portal/src/test/java/
   portal/trunk/webui/portal/src/test/java/org/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java
   portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java
   portal/trunk/webui/portal/src/test/resources/
   portal/trunk/webui/portal/src/test/resources/conf/
   portal/trunk/webui/portal/src/test/resources/conf/portal/
   portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml
   portal/trunk/webui/portal/src/test/resources/webui-configuration.xml
Modified:
   portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java
   portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java
   portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java
   portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
   portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
   portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
   portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
   portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java
   portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java
   portal/trunk/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
   portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml
   portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml
   portal/trunk/examples/portlets/jsfhellouser/pom.xml
   portal/trunk/examples/skins/simpleskin/src/main/resources/tomcat/simpleDeployableSkin.xml
   portal/trunk/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml
   portal/trunk/portlet/dashboard/src/main/resources/tomcat/dashboard.xml
   portal/trunk/portlet/exoadmin/src/main/resources/tomcat/exoadmin.xml
   portal/trunk/portlet/web/src/main/resources/tomcat/web.xml
   portal/trunk/testsuite/webuibasedsamples/src/main/resources/tomcat/portlets.xml
   portal/trunk/web/eXoResources/src/main/resources/tomcat/eXoResources.xml
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
   portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js
   portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
   portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy
   portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.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/portal/UIPortletForm.gtmpl
   portal/trunk/web/portal/src/main/webapp/groovy/webui/organization/account/UIUserSelector.gtmpl
   portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java
   portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
   portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java
   portal/trunk/webui/portal/pom.xml
Log:
GTNPORTAL-1700: Merge the commit branch of sprint 43 back to trunk

Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/AbstractApplicationRegistryTest.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -32,14 +32,4 @@
 })
 public abstract class AbstractApplicationRegistryTest extends AbstractKernelTest
 {
-
-/*
-   public void testFoo() throws Exception
-   {
-      PortalContainer container = PortalContainer.getInstance();
-      ApplicationRegistryService registry = (ApplicationRegistryService)container.getComponentInstanceOfType(ApplicationRegistryService.class);
-      registry.getAllApplications();
-   }
-*/
-
 }

Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/gadget/TestSourceStorageService.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,155 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- * 
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- * 
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.application.gadget;
-
-import org.exoplatform.component.test.AbstractGateInTest;
-
-/**
- * todo julien : fix or remove
- *
- * Thu, May 15, 2004 @   
- * @author: Tuan Nguyen
- * @version: $Id: TestResourceBundleService.java 5799 2006-05-28 17:55:42Z geaz $
- * @since: 0.0
- * @email: tuan08 at yahoo.com
- */
-public class TestSourceStorageService extends AbstractGateInTest
-{
-
-   private SourceStorage service_;
-
-   public void setUp() throws Exception
-   {
-      //    PortalContainer manager  = PortalContainer.getInstance();
-      //    service_ = (SourceStorage) manager.getComponentInstanceOfType(SourceStorage.class) ;
-   }
-
-   public void testSourceStorageAdd() throws Exception
-   {
-      //    //-------Insert Source Storeage 1--------
-      //    Source source1 = new Source("Calculator.xml", "application/xml", "UTF-8");
-      //    source1.setTextContent("Gadget's content");
-      //    source1.setLastModified(Calendar.getInstance());
-      //    service_.saveSource("source", source1) ; 
-      //    
-      //    //-------Check Source Storeage's content added--------
-      //    Source sourceGet = service_.getSource("source/Calculator.xml");
-      //    assertEquals("Gadget's content", sourceGet.getTextContent());
-      //    
-      //    //-------Insert Source Storeage 2 with path is null--------
-      //    Source source2 = new Source("Todo.xml", "application/xml", "UTF-8");
-      //    source2.setTextContent("Gadget's content");
-      //    source2.setLastModified(Calendar.getInstance());
-      //    service_.saveSource(null, source2) ; 
-      //    
-      //    //-------Check Source Storeage's content added--------
-      //    Source sourceGet2 = service_.getSource("Todo.xml");
-      //    assertEquals("Gadget's content", sourceGet2.getTextContent());
-      //    
-      //    //-------Insert Source Storeage 2 with text content is null--------
-      //    Source source3 = new Source("Todo.xml", "application/xml", "UTF-8");
-      //    source3.setTextContent(null);
-      //    source3.setLastModified(Calendar.getInstance());
-      //    service_.saveSource("source", source3) ; 
-      //    
-      //    Source sourceGet3 = service_.getSource("source/Todo.xml");
-      //    System.out.println("\n\n\n\n\n\n\n\n\naaa" + service_.getSourceURI("source/Todo.xml"));
-      //    assertTrue("Expect text content is empty", sourceGet3.getTextContent().equals(""));
-      //    
-   }
-   //  
-   //  public void testSourceStorageUpdate() throws Exception {    
-   //    //-------Insert Source Storeage 1--------
-   //    Source source = new Source("Calculator.xml", "application/xml", "UTF-8");
-   //    source.setTextContent("Gadget's content");
-   //    source.setLastModified(Calendar.getInstance());
-   //    service_.saveSource("source", source) ; 
-   //    
-   //    //-------Check Source Storeage's content added--------
-   //    Source sourceGet = service_.getSource("source/Calculator.xml");
-   //    assertEquals("Gadget's content", sourceGet.getTextContent());
-   //    
-   //    //-------Update Source Storeage's just added to database--------
-   //    source.setTextContent("Gadget's content update");
-   //    service_.saveSource("source", source);
-   //    
-   //    //-------Check Source Storeage's content just updated--------
-   //    sourceGet = service_.getSource("source/Calculator.xml");
-   //    assertEquals("Gadget's content update", sourceGet.getTextContent());
-   //    
-   //  }
-   //  
-   //  public void testSourceStorageRemove() throws Exception {    
-   //    //-------Insert Source Storeage 1--------
-   //    Source source = new Source("Calculator.xml", "application/xml", "UTF-8");
-   //    source.setTextContent("Gadget's content");
-   //    source.setLastModified(Calendar.getInstance());
-   //    service_.saveSource("source", source) ; 
-   //    
-   //    //-------Check Source Storeage's content added--------
-   //    Source sourceGet = service_.getSource("source/Calculator.xml");
-   //    assertEquals("Gadget's content", sourceGet.getTextContent());
-   //    
-   //    //System.out.println("\n\n\n\n\n\naaaa" + sourceGet.getName());
-   //    //-------Remove Source Storeage's content added--------
-   //    service_.removeSource("source/Calculator.xml");
-   //    sourceGet = service_.getSource("source/Calculator.xml");
-   //    //-------Check Source Storeage is really removed--------
-   //    assertTrue("Expect source is null", sourceGet==null);
-   //    
-   //  }
-   //  
-   //  public void testSourceStorageList() throws Exception {
-   //    //-------Check list of Source Storeage is empty--------
-   //    Source sourceGet = service_.getSource("source");
-   //    
-   //    assertTrue("First, none of source exist", sourceGet == null);
-   //    
-   //    //-------Insert Source Storeage1--------
-   //    Source source1 = new Source("Calculator.xml", "application/xml", "UTF-8");
-   //    source1.setTextContent("Gadget's content");
-   //    source1.setLastModified(Calendar.getInstance());
-   //    service_.saveSource("source", source1) ; 
-   //    
-   //    //-------Check Source Storeage1's content added--------
-   //    sourceGet = service_.getSource("source/Calculator.xml");
-   //    assertEquals("Gadget's content", sourceGet.getTextContent());
-   //    
-   //    //-------Insert Source Storeage2--------
-   //    Source source2 = new Source("Todo.xml", "application/xml", "UTF-8");
-   //    source2.setTextContent("Gadget's content");
-   //    source2.setLastModified(Calendar.getInstance());
-   //    service_.saveSource("source", source2) ; 
-   //    
-   //    //-------Check Source Storeage2's content added--------
-   //    Source sourceGet2 = service_.getSource("source/Todo.xml");
-   //    assertEquals("Gadget's content", sourceGet2.getTextContent());
-   //    
-   //  }
-   //  
-   //  protected String getDescription() {
-   //    return "Test Source Storage Service" ;
-   //  }
-   //  
-   //  public void tearDown() throws Exception {
-   //    // remove all data test
-   //    service_.removeSource("source");
-   //  }
-}

Modified: portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/application-registry/src/test/java/org/exoplatform/application/registry/TestApplicationRegistryService.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -64,12 +64,6 @@
 
    protected OrganizationService orgService;
 
-/*
-   protected int initialCats;
-
-   protected int initialApps;
-*/
-
    protected ChromatticManager chromatticManager;
 
    @Override
@@ -151,160 +145,12 @@
       chessApp.setAccessPermissions(pers);
       service_.save(gameCategory, chessApp);
 
-      List<ApplicationCategory> returnCategorys = service_.getApplicationCategories(username1);
-      for (ApplicationCategory cate : returnCategorys)
-      {
-         System.out.println("\n\n\ncateName: " + cate.getName());
-         List<Application> apps = service_.getApplications(cate);
-         for (Application app : apps)
-         {
-            System.out.println("\nappName: " + app.getApplicationName() + "---" + app.getAccessPermissions());
-         }
-      }
-      assertEquals(2, returnCategorys.size());
+      List<ApplicationCategory> returnCategories = service_.getApplicationCategories(username1);
+      assertEquals(2, returnCategories.size());
+      assertEquals(2, returnCategories.get(0).getApplications().size());
+      assertEquals(2, returnCategories.get(1).getApplications().size());
    }
-/*
-
-   void assertApplicationOperation(ApplicationRegistryService service) throws Exception
-   {
-      assertApplicationSave(service);
-      assertApplicationUpdate(service);
-      assertApplicationRemove(service);
-   }
-
-   void assertApplicationSave(ApplicationRegistryService service) throws Exception
-   {
-      String categoryName = "Office";
-      String appType = "TypeOne";
-      String appGroup = "GroupOne";
-      String[] appNames = {"OpenOffice_org", "MS_Office"};
-
-      ApplicationCategory appCategory = createAppCategory(categoryName, "None");
-      service.save(appCategory);
-
-      for (String appName : appNames)
-      {
-         Application app = createApplication(appName, appType, appGroup);
-         app.setCategoryName(categoryName);
-         service.save(appCategory, app);
-      }
-
-      List<Application> apps = service.getApplications(appCategory);
-      assertEquals(2, apps.size());
-
-      for (String appName : appNames)
-      {
-         String appId = categoryName + "/" + appName;
-
-         Application app = service.getApplication(appId);
-         assertEquals(appName, app.getApplicationName());
-      }
-      //    service.clearAllRegistries() ;
-   }
-
-   void assertApplicationUpdate(ApplicationRegistryService service) throws Exception
-   {
-      String categoryName = "Office";
-      String appType = "TypeOne";
-      String appGroup = "GroupOne";
-      String[] appNames = {"OpenOffice_org", "MS_Office"};
-
-      ApplicationCategory appCategory = createAppCategory(categoryName, "None");
-      service.save(appCategory);
-
-      // Save apps with description
-      for (String appName : appNames)
-      {
-         String oldDesciption = "This is: " + appName;
-         Application app = createApplication(appName, appType, appGroup);
-         app.setCategoryName(categoryName);
-         app.setDescription(oldDesciption);
-         service.save(appCategory, app);
-      }
-
-      for (String appName : appNames)
-      {
-         String appId = categoryName + "/" + appName;
-         String oldDesciption = "This is: " + appName;
-
-         Application app = service.getApplication(appId);
-         assertEquals(oldDesciption, app.getDescription());
-      }
-
-      // Update apps with new description: use save() method
-      List<Application> apps = service.getApplications(appCategory);
-      for (Application app : apps)
-      {
-         String newDesciption = "This is: " + app.getApplicationName() + " suite.";
-         app.setDescription(newDesciption);
-         service.save(appCategory, app);
-
-      }
-
-      for (String appName : appNames)
-      {
-         String appId = categoryName + "/" + appName;
-
-         Application app = service.getApplication(appId);
-         String newDesciption = "This is: " + app.getApplicationName() + " suite.";
-         assertEquals(newDesciption, app.getDescription());
-      }
-
-      // Update apps with new description: use update() method
-      for (String appName : appNames)
-      {
-         String appId = categoryName + "/" + appName;
-         String newDesciption = "This is new : " + appName + " suite.";
-
-         Application app = service.getApplication(appId);
-         app.setDescription(newDesciption);
-         service.update(app);
-      }
-
-      for (String appName : appNames)
-      {
-         String appId = categoryName + "/" + appName;
-         String newDesciption = "This is new : " + appName + " suite.";
-         Application app = service.getApplication(appId);
-         assertEquals(newDesciption, app.getDescription());
-      }
-
-      List<Application> apps2 = service.getApplications(appCategory);
-      assertEquals(2, apps2.size());
-
-      //    service.clearAllRegistries() ;
-   }
-
-   void assertApplicationRemove(ApplicationRegistryService service) throws Exception
-   {
-      String categoryName = "Office";
-      String appType = "TestType";
-      String appGroup = "TestGroup";
-      String[] appNames = {"OpenOffice_org", "MS_Office"};
-
-      ApplicationCategory appCategory = createAppCategory(categoryName, "None");
-      service.save(appCategory);
-
-      for (String appName : appNames)
-      {
-         Application app = createApplication(appName, appType, appGroup);
-         app.setCategoryName(categoryName);
-         service.save(appCategory, app);
-      }
-
-      List<Application> apps = service.getApplications(appCategory);
-      assertEquals(2, apps.size());
-
-      for (Application app : apps)
-      {
-         service.remove(app);
-      }
-
-      List<Application> apps2 = service.getApplications(appCategory);
-      assertEquals(0, apps2.size());
-      //    service.clearAllRegistries() ;
-   }
-*/
+   
    private ApplicationCategory createAppCategory(String categoryName, String categoryDes)
    {
       ApplicationCategory category = new ApplicationCategory();
@@ -313,6 +159,7 @@
       category.setDescription(categoryDes);
       return category;
    }
+   
    private Application createApplication(String appName, String appGroup)
    {
       Application app = new Application();
@@ -322,90 +169,4 @@
       app.setType(ApplicationType.PORTLET);
       return app;
    }
-
-/*
-   private void prepareOrganizationData() throws Exception
-   {
-      groupDefault = orgService.getGroupHandler().findGroupById("/platform/users");
-      if (group1 == null)
-      {
-         group1 = createGroup(orgService, Group1);
-      }
-      if (group2 == null)
-      {
-         group2 = createGroup(orgService, Group2);
-      }
-
-      mTypeDefault = orgService.getMembershipTypeHandler().findMembershipType("member");
-      if (mType1 == null)
-      {
-         mType1 = createMembershipType(orgService, memtype1);
-      }
-      if (mType2 == null)
-      {
-         mType2 = createMembershipType(orgService, memtype2);
-      }
-
-      if (user1 == null)
-      {
-         user1 = createUser(orgService, username1);
-         createDataUser(orgService, user1);
-      }
-      if (user2 == null)
-      {
-         user2 = createUser(orgService, username2);
-         createDataUser(orgService, user2);
-      }
-
-      userDefault = orgService.getUserHandler().findUserByName(demo);
-   }
-
-   private Group createGroup(OrganizationService orgService, String groupName) throws Exception
-   {
-      Group savedGroup = orgService.getGroupHandler().findGroupById("/" + groupName);
-      if (savedGroup != null)
-         return savedGroup;
-      Group groupParent = orgService.getGroupHandler().createGroupInstance();
-      groupParent.setGroupName(groupName);
-      groupParent.setDescription("This is description");
-      orgService.getGroupHandler().addChild(null, groupParent, true);
-      return groupParent;
-   }
-
-   private MembershipType createMembershipType(OrganizationService orgService, String name) throws Exception
-   {
-      MembershipType savedMt = orgService.getMembershipTypeHandler().findMembershipType(name);
-      if (savedMt != null)
-         return savedMt;
-      MembershipType mt = orgService.getMembershipTypeHandler().createMembershipTypeInstance();
-      mt.setName(name);
-      mt.setDescription("This is a test");
-      mt.setOwner("exo");
-      orgService.getMembershipTypeHandler().createMembershipType(mt, true);
-      return mt;
-   }
-
-   @SuppressWarnings("deprecation")
-   private User createUser(OrganizationService orgService, String userName) throws Exception
-   {
-      User savedUser = orgService.getUserHandler().findUserByName(userName);
-      if (savedUser != null)
-         return savedUser;
-      User user = orgService.getUserHandler().createUserInstance(userName);
-      user.setPassword("default");
-      user.setFirstName("default");
-      user.setLastName("default");
-      user.setEmail("exo at exoportal.org");
-      orgService.getUserHandler().createUser(user, true);
-      return user;
-   }
-
-   private User createDataUser(OrganizationService orgService, User u) throws Exception
-   {
-      UserProfile up = orgService.getUserProfileHandler().findUserProfileByName(u.getUserName());
-      up.getUserInfoMap().put("user.gender", "male");
-      orgService.getUserProfileHandler().saveUserProfile(up, true);
-      return u;
-   }
-*/
 }

Modified: portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java
===================================================================
--- portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/identity/src/test/java/org/exoplatform/services/organization/TestOrganizationService.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -117,12 +117,6 @@
       RequestLifeCycle.end();
    }
 
-   public void testSimle() throws Exception
-   {
-      assertTrue(true);
-
-   }
-
    public void testUserPageSize() throws Exception
    {
       for (String name : USERS)

Modified: portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java
===================================================================
--- portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/portal/src/test/java/org/exoplatform/portal/config/TestOrganization.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,16 +19,15 @@
 
 package org.exoplatform.portal.config;
 
+import java.util.Collection;
 import org.exoplatform.commons.utils.PageList;
 import org.exoplatform.container.PortalContainer;
+import org.exoplatform.services.organization.Group;
 import org.exoplatform.services.organization.GroupHandler;
 import org.exoplatform.services.organization.OrganizationService;
 import org.exoplatform.services.organization.User;
 import org.exoplatform.services.organization.UserHandler;
 
-import java.util.Collection;
-import java.util.List;
-
 /**
  * Created by The eXo Platform SARL Author : Tung Pham thanhtungty at gmail.com Nov
  * 13, 2007
@@ -36,6 +35,16 @@
 public class TestOrganization extends AbstractPortalTest
 {
 
+	private static final String GROUP_1 = "testOrganization_group1";
+	private static final String GROUP_2 = "testOrganization_group2";
+	private static final String GROUP_3 = "testOrganization_group3";
+	
+	private static final String USER_1 = "testOrganization_user1";
+	private static final String USER_2 = "testOrganization_user2";
+	private static final String USER_3 = "testOrganization_user3";
+	private static final String DEFAULT_PASSWORD = "defaultpassword";
+	private static final String DESCRIPTION = " Description";
+	
    private OrganizationService organizationService;
 
    @Override
@@ -45,59 +54,148 @@
       begin();
       PortalContainer container = getContainer();
       organizationService = (OrganizationService)container.getComponentInstance(OrganizationService.class);
+      
+      createGroup(null, GROUP_1);
+      createGroup(GROUP_1, GROUP_2);
+      createGroup(GROUP_1, GROUP_3);
+      
+      createUser(USER_1, GROUP_1);
+      createUser(USER_2, GROUP_2);
+      createUser(USER_3, GROUP_1);
    }
 
    @Override
    protected void tearDown() throws Exception
    {
-      end();
+	  deleteGroup(GROUP_1);
+	  deleteGroup(GROUP_2);
+	  deleteGroup(GROUP_3);
+	  
+	  deleteUser(USER_1);
+	  deleteUser(USER_2);
+	  deleteUser(USER_3);
+	  
+      end(false);
       super.tearDown();
    }
 
-   public void testFindGroups() throws Exception
+   public void testFindGroupNotFound() throws Exception {
+	   GroupHandler groupHander = organizationService.getGroupHandler();
+	   Group group = groupHander.findGroupById(GROUP_1 + "NOTFOUND");
+	   assertNull(group);
+   }
+   
+   public void testFindGroupFromRoot() throws Exception
    {
       GroupHandler handler = organizationService.getGroupHandler();
-      Collection allGroups = handler.findGroups(null);
+      Collection<Group> allGroups = handler.findGroups(null);
+      assertNotNull(allGroups);
       assertTrue(allGroups.size() > 0);
    }
 
    public void testFindGroupById() throws Exception
    {
-      GroupHandler uHandler = organizationService.getGroupHandler();
-      Collection group = uHandler.findGroupsOfUser("root");
+      GroupHandler groupHandler = organizationService.getGroupHandler();
+      Group group = groupHandler.findGroupById(GROUP_1);
+      assertNotNull(group);
+      assertEquals(GROUP_1, group.getGroupName());
+      assertEquals(GROUP_1 + DESCRIPTION, group.getDescription());
+      
+      group = groupHandler.findGroupById(GROUP_3);
+      assertNotNull(group);
+      assertEquals(GROUP_3, group.getGroupName());
    }
+   
+   public void testFindGroupOfUser() {
+	   GroupHandler groupHandler = organizationService.getGroupHandler();
+	   try {
+		Collection<Group> groups = groupHandler.findGroupsOfUser(USER_1);
+		assertNotNull(groups);
+		assertTrue(groups.size() >= 1);
+	} catch (Exception e) {
+		fail();
+	}
+   }
 
    public void testFindUserByGroup() throws Exception
    {
+	  GroupHandler groupHandler = organizationService.getGroupHandler();
+	  Group group = groupHandler.findGroupById(GROUP_1);
       UserHandler uHandler = organizationService.getUserHandler();
-      PageList users = uHandler.findUsersByGroup("/platform/administrators");
-      assertTrue(users.getAvailable() > 0);
-
-      List iterator = users.getAll();
-      for (Object test : iterator)
-      {
-         User a = (User)test;
-         System.out.println(a.getUserName());
-      }
+      PageList<User> users = uHandler.findUsersByGroup(group.getId());
+      assertNotNull(users);
+      assertTrue(users.getPageSize() > 0);
    }
 
    public void testChangePassword() throws Exception
    {
       UserHandler uHandler = organizationService.getUserHandler();
-      User user = uHandler.findUserByName("root");
+      User user = uHandler.findUserByName(USER_1);
       assertNotNull(user);
-      assertTrue(uHandler.authenticate("root", "gtn"));
+      assertTrue(uHandler.authenticate(USER_1, DEFAULT_PASSWORD));
       
       // Test changing password
       user.setPassword("newPassword");
       uHandler.saveUser(user, false);
-      user = uHandler.findUserByName("root");
+      user = uHandler.findUserByName(USER_1);
       assertNotNull(user);
-      assertTrue(uHandler.authenticate("root", "newPassword"));    
-
-      // Reset to default password
-      user.setPassword("gtn");
-      uHandler.saveUser(user, false);
-
+      assertTrue(uHandler.authenticate(USER_1, "newPassword"));
    }
+   
+   
+   private void createGroup(String parent, String name) {
+	   GroupHandler groupHandler = organizationService.getGroupHandler();
+	   try {
+		   Group parentGroup = null;
+		   if(parent != null) {
+			   parentGroup = groupHandler.findGroupById(parent);
+		   }
+		   Group newGroup = groupHandler.createGroupInstance();
+		   newGroup.setGroupName(name);
+		   newGroup.setDescription(name + DESCRIPTION);
+		   newGroup.setLabel(name);
+		   if(parentGroup != null) {
+			   groupHandler.addChild(parentGroup, newGroup, true);
+		   }
+		   groupHandler.saveGroup(newGroup, true);
+		   
+	   } catch (Exception e) {
+			e.printStackTrace();
+			fail("Error on create group [" + name + "] " + e.getMessage());
+	   }
+	   
+   }
+   
+   private void deleteGroup(String name) {
+	   GroupHandler groupHandler = organizationService.getGroupHandler();
+	   try {
+		Group group = groupHandler.findGroupById(name);
+		groupHandler.removeGroup(group, true);
+	} catch (Exception e) {
+		
+	}
+   }
+   
+   private void createUser(String username, String... groups) {
+	   UserHandler userHandler = organizationService.getUserHandler();
+	   User user = userHandler.createUserInstance(username);
+	   user.setPassword(DEFAULT_PASSWORD);
+	   user.setFirstName("default");
+	   user.setLastName("default");
+	   user.setEmail("exo at exoportal.org");
+	   user.setOrganizationId(groups[0]);
+	   try {
+		userHandler.createUser(user, true);
+	   } catch (Exception e) {
+		   e.printStackTrace();
+		   fail("Error on create user: " + e.getMessage());
+	   }
+   }
+   private void deleteUser(String username) {
+	   UserHandler userHandler = organizationService.getUserHandler();
+	   try {
+		   userHandler.removeUser(username, true);
+	   } catch (Exception e) {
+	   }	   
+   }
 }

Modified: portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -22,6 +22,7 @@
 import org.exoplatform.commons.utils.IOUtil;
 import org.exoplatform.commons.utils.MapResourceBundle;
 import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.commons.utils.PropertyManager;
 import org.exoplatform.container.xml.InitParams;
 import org.exoplatform.services.cache.ExoCache;
 import org.exoplatform.services.log.Log;
@@ -42,12 +43,10 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.ResourceBundle;
-import java.util.Set;
 
 /**
  * Created by The eXo Platform SAS Mar 9, 2007
@@ -383,11 +382,6 @@
          return IdentityResourceBundle.getInstance();
       }
 
-      // Case 1: ResourceBundle of portlets, standard java API is used
-      if (isClasspathResource(name))
-         return ResourceBundleLoader.load(name, locale, cl);
-
-      // Case 2: ResourceBundle of portal
       String country = locale.getCountry();
       String id;
       if (country != null && country.length() > 0)
@@ -399,18 +393,39 @@
          id = name + "_" + locale.getLanguage();
       }
 
-      try
+      boolean isClasspathResource = isClasspathResource(name);
+      boolean isCacheable = !isClasspathResource || !PropertyManager.isDevelopping();
+      if (isCacheable)
       {
-         ResourceBundle rb = cache_.get(id);
-         if (rb != null)
+         if (isClasspathResource)
          {
-            return rb;
+            // Avoid naming collision
+            id += "_" + cl.getClass() + "_" + cl.hashCode();
          }
+         try
+         {
+            ResourceBundle rb = cache_.get(id);
+            if (rb != null)
+            {
+               return rb;
+            }
+         }
+         catch (Exception ex)
+         {
+         }         
       }
-      catch (Exception ex)
+
+      // Case 1: ResourceBundle of portlets, standard java API is used
+      if (isClasspathResource)
       {
+         ResourceBundle res = ResourceBundleLoader.load(name, locale, cl);
+         //Cache classpath resource bundle while running portal in non-dev mode
+         if (isCacheable)
+            cache_.put(id, res);
+         return res;
       }
 
+      // Case 2: ResourceBundle of portal
       try
       {
          ResourceBundle res = null;

Modified: portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
===================================================================
--- portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,8 +19,13 @@
 
 package org.exoplatform.services.resources.test;
 
+import org.exoplatform.commons.utils.PropertyManager;
 import org.exoplatform.container.PortalContainer;
-import org.exoplatform.services.resources.*;
+import org.exoplatform.services.resources.AbstractResourceBundleTest;
+import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.Query;
+import org.exoplatform.services.resources.ResourceBundleData;
+import org.exoplatform.services.resources.ResourceBundleService;
 
 import java.util.List;
 import java.util.Locale;
@@ -178,4 +183,33 @@
    {
       return "Test Resource Bundle Service";
    }
+   
+   public void testClasspathResourceCache()
+   {
+      String oldValue = PropertyManager.getProperty(PropertyManager.DEVELOPING);
+      try
+      {
+         PropertyManager.setProperty(PropertyManager.DEVELOPING, "false");
+         assertFalse(PropertyManager.isDevelopping());
+         MyClassLoader cl1 = new MyClassLoader();
+         ResourceBundle res = service_.getResourceBundle("locale.portlet", Locale.ENGLISH, cl1);
+         assertNotNull(res);
+         assertTrue(res == service_.getResourceBundle("locale.portlet", Locale.ENGLISH, cl1));
+         assertFalse(res == service_.getResourceBundle("locale.portlet", Locale.ENGLISH, new MyClassLoader()));
+      }
+      finally
+      {
+         PropertyManager.setProperty(PropertyManager.DEVELOPING, oldValue);
+      }
+   }
+   
+   private static class MyClassLoader extends ClassLoader
+   {
+
+      @Override
+      public String toString()
+      {
+         return "MyClassLoader";
+      }
+   }
 }

Copied: portal/trunk/component/resources/src/test/resources/locale/portlet_en.properties (from rev 5501, portal/branches/branch-GTNPORTAL-1700/component/resources/src/test/resources/locale/portlet_en.properties)
===================================================================
--- portal/trunk/component/resources/src/test/resources/locale/portlet_en.properties	                        (rev 0)
+++ portal/trunk/component/resources/src/test/resources/locale/portlet_en.properties	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2009 eXo Platform SAS.
+# 
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+# 
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+# 
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+language.language=English

Modified: portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java
===================================================================
--- portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ExtensibleFilter.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -29,7 +29,6 @@
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
 
 /**
  * This class allows the rest of the platform to define new filters thanks to the external
@@ -40,7 +39,7 @@
  *          nicolas.filotto at exoplatform.com
  * 25 sept. 2009  
  */
-public class ExtensibleFilter implements Filter
+public class ExtensibleFilter
 {
 
    /**
@@ -74,32 +73,31 @@
       }
    }
 
-   /**
-    * @see Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
-    */
-   public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
-      ServletException
+   public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain, String path)
+      throws IOException, ServletException
    {
-      ExtensibleFilterChain efChain = new ExtensibleFilterChain(chain, filters);
+      ExtensibleFilterChain efChain = new ExtensibleFilterChain(chain, filters, path);
       efChain.doFilter(request, response);
    }
-
+   
    private static class ExtensibleFilterChain implements FilterChain
    {
 
       private final FilterChain parentChain;
 
       private final Iterator<FilterDefinition> filters;
+      
+      private final String path;
 
-      private ExtensibleFilterChain(FilterChain parentChain, List<FilterDefinition> filters)
+      private ExtensibleFilterChain(FilterChain parentChain, List<FilterDefinition> filters, String path_)
       {
          this.parentChain = parentChain;
          this.filters = filters.iterator();
+         this.path = path_;
       }
 
       public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException
       {
-         String path = ((HttpServletRequest)request).getRequestURI();
          while (filters.hasNext())
          {
             FilterDefinition filterDef = filters.next();

Modified: portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java
===================================================================
--- portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/GenericFilter.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -23,11 +23,15 @@
 import org.exoplatform.container.web.AbstractFilter;
 
 import java.io.IOException;
+import java.util.regex.Pattern;
 
 import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
 
 /**
  * This filter allows the rest of the platform to add their own filters without changing the web.xml
@@ -41,12 +45,20 @@
 public class GenericFilter extends AbstractFilter
 {
 
+   private Pattern contextPathPattern;
    /**
     * @see javax.servlet.Filter#destroy()
     */
    public void destroy()
    {
    }
+   
+   @Override
+   protected void afterInit(FilterConfig config) throws ServletException
+   {
+      ServletContext servletContext = this.getServletContext();
+      contextPathPattern = Pattern.compile("[/]*" + servletContext.getContextPath() + "[/]*");
+   }
 
    /**
     * This filter calls <code>doFilter</code> of the {@link ExtensibleFilter} of 
@@ -63,7 +75,8 @@
       }
       else
       {
-         filter.doFilter(request, response, chain);
+         String path = contextPathPattern.matcher(((HttpServletRequest)request).getRequestURI()).replaceFirst("/");
+         filter.doFilter(request, response, chain, path);
       }
    }
 }

Copied: portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/RedefinableResourceFilter.java (from rev 5501, portal/branches/branch-GTNPORTAL-1700/component/web/api/src/main/java/org/exoplatform/web/filter/RedefinableResourceFilter.java)
===================================================================
--- portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/RedefinableResourceFilter.java	                        (rev 0)
+++ portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/RedefinableResourceFilter.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2003-2010 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.web.filter;
+
+import java.io.IOException;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+
+import org.exoplatform.container.PortalContainer;
+
+/**
+ * A filter enables resource overriding via extension mechanism.
+ * 
+ * @author <a href="mailto:hoang281283 at gmail.com">Minh Hoang TO</a>
+ * Sep 8, 2010
+ */
+
+public class RedefinableResourceFilter implements Filter {
+
+	@Override
+	public void doFilter(ServletRequest request, ServletResponse response,
+			FilterChain chain) throws IOException, ServletException {
+		
+		HttpServletRequest upcastedRequest = (HttpServletRequest)request;
+		
+		PortalContainer portalContainer = PortalContainer.getInstance();
+		ServletContext mergedContext = portalContainer.getPortalContext();
+		
+		String path = upcastedRequest.getRequestURI();
+		String ctx = upcastedRequest.getContextPath();
+		
+		if(ctx != null && ctx.length() > 0 && path.startsWith(ctx))
+		{
+			path = path.substring(ctx.length());
+		}
+
+		mergedContext.getRequestDispatcher(path).include(request, response);
+	}
+
+}

Deleted: portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java
===================================================================
--- portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/web/api/src/main/java/org/exoplatform/web/filter/ResourceOverridingFilter.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2003-2010 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
- */
-package org.exoplatform.web.filter;
-
-import java.io.IOException;
-
-import javax.servlet.FilterChain;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-
-import org.exoplatform.container.PortalContainer;
-
-/**
- * A filter enables resource overriding via extension mechanism.
- * 
- * @author <a href="mailto:hoang281283 at gmail.com">Minh Hoang TO</a>
- * Sep 8, 2010
- */
-
-public class ResourceOverridingFilter implements Filter {
-
-	@Override
-	public void doFilter(ServletRequest request, ServletResponse response,
-			FilterChain chain) throws IOException, ServletException {
-		
-		HttpServletRequest upcastedRequest = (HttpServletRequest)request;
-		
-		PortalContainer portalContainer = PortalContainer.getInstance();
-		ServletContext mergedContext = portalContainer.getPortalContext();
-		
-		String path = upcastedRequest.getRequestURI();
-		String ctx = upcastedRequest.getContextPath();
-		
-		if(ctx != null && ctx.length() > 0 && path.startsWith(ctx))
-		{
-			path = path.substring(ctx.length());
-		}
-
-		mergedContext.getRequestDispatcher(path).include(request, response);
-	}
-
-}

Modified: portal/trunk/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java
===================================================================
--- portal/trunk/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/component/web/api/src/test/java/org/exoplatform/web/filter/TestExtensibleFilter.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -52,13 +52,14 @@
 
    public void testDoFilter() throws IOException, ServletException
    {
+      String pathRequest = "/testPath";
       ExtensibleFilter exFilter = new ExtensibleFilter();
       MockFilterOKTF mockFilterOKTF = new MockFilterOKTF();
       MockFilterOKWTF mockFilterOKWTF = new MockFilterOKWTF();
       MockFilterChain chain = new MockFilterChain();
       exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF),
          getFilterDefinition(mockFilterOKWTF)));
-      exFilter.doFilter(new MockServletRequest(), null, chain);
+      exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
       assertTrue(mockFilterOKTF.start);
       assertTrue(mockFilterOKTF.end);
       assertTrue(mockFilterOKWTF.start);
@@ -70,7 +71,7 @@
       chain = new MockFilterChain();
       exFilter.addFilterDefinitions(Arrays.asList(getFilterDefinition(mockFilterOKTF),
          getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKO())));
-      exFilter.doFilter(new MockServletRequest(), null, chain);
+      exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
       assertTrue(mockFilterOKTF.start);
       assertTrue(mockFilterOKTF.end);
       assertTrue(mockFilterOKWTF.start);
@@ -84,7 +85,7 @@
          getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOIO())));
       try
       {
-         exFilter.doFilter(new MockServletRequest(), null, chain);
+         exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
          fail("IOException is expected");
       }
       catch (IOException e)
@@ -103,7 +104,7 @@
          getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOSE())));
       try
       {
-         exFilter.doFilter(new MockServletRequest(), null, chain);
+         exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
          fail("ServletException is expected");
       }
       catch (ServletException e)
@@ -122,7 +123,7 @@
          getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKORE())));
       try
       {
-         exFilter.doFilter(new MockServletRequest(), null, chain);
+         exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
          fail("RuntimeException is expected");
       }
       catch (RuntimeException e)
@@ -141,7 +142,7 @@
          getFilterDefinition(mockFilterOKWTF), getFilterDefinition(new MockFilterKOER())));
       try
       {
-         exFilter.doFilter(new MockServletRequest(), null, chain);
+         exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
          fail("Error is expected");
       }
       catch (Error e)
@@ -162,7 +163,7 @@
          getFilterDefinition(mockFilterOKTF2)));
       try
       {
-         exFilter.doFilter(new MockServletRequest(), null, chain);
+         exFilter.doFilter(new MockServletRequest(), null, chain, pathRequest);
          fail("IOException is expected");
       }
       catch (IOException e)

Modified: portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml
===================================================================
--- portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/examples/extension/war/src/main/resources/tomcat/sample-ext.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1 +1 @@
-<Context path="/sample-ext" docBase="../../../../../examples/extension/war/src/main/webapp/" debug="0" reloadable="true" crossContext="true"/>
+<Context path="/sample-ext" docBase="../../../../../../examples/extension/war/src/main/webapp/" debug="0" reloadable="true" crossContext="true"/>

Modified: portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml
===================================================================
--- portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/examples/portal/war/src/main/resources/tomcat/sample-portal.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1 +1 @@
-<Context path="/sample-portal" docBase="../../../../../examples/portal/war/src/main/webapp/" debug="0" reloadable="true" crossContext="true"/>
+<Context path="/sample-portal" docBase="../../../../../../examples/portal/war/src/main/webapp/" debug="0" reloadable="true" crossContext="true"/>

Modified: portal/trunk/examples/portlets/jsfhellouser/pom.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/pom.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/examples/portlets/jsfhellouser/pom.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -49,6 +49,16 @@
          <artifactId>portletbridge-impl</artifactId>
          <version>2.0.0.FINAL</version>
       </dependency>
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-api</artifactId>
+         <version>1.2_13</version>
+      </dependency>
+      <dependency>
+         <groupId>javax.faces</groupId>
+         <artifactId>jsf-impl</artifactId>
+         <version>1.2_13</version>
+      </dependency>
 
    </dependencies>
 

Modified: portal/trunk/examples/skins/simpleskin/src/main/resources/tomcat/simpleDeployableSkin.xml
===================================================================
--- portal/trunk/examples/skins/simpleskin/src/main/resources/tomcat/simpleDeployableSkin.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/examples/skins/simpleskin/src/main/resources/tomcat/simpleDeployableSkin.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1 +1 @@
-<Context path="/simpleDeployableSkin" docBase="../../../../../examples/skins/simpleskin/src/main/webapp/" debug="0" reloadable="true" crossContext="true"/>
+<Context path="/simpleDeployableSkin" docBase="../../../../../../examples/skins/simpleskin/src/main/webapp/" debug="0" reloadable="true" crossContext="true"/>

Modified: portal/trunk/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,5 +19,5 @@
 
 -->
 
-<Context path="/eXoGadgetWeb" docBase="../../../eXoProjects/portal/trunk/gadgets/eXoGadgets/src/main/webapp" 
+<Context path="/eXoGadgetWeb" docBase="../../../../../../gadgets/eXoGadgets/src/main/webapp" 
          debug="0" reloadable="true" />

Modified: portal/trunk/portlet/dashboard/src/main/resources/tomcat/dashboard.xml
===================================================================
--- portal/trunk/portlet/dashboard/src/main/resources/tomcat/dashboard.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/portlet/dashboard/src/main/resources/tomcat/dashboard.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,5 +19,5 @@
 
 -->
 
-<Context path="/dashboard" docBase="../../../eXoProjects/portal/trunk/portlet/dashboard/src/main/webapp"
+<Context path="/dashboard" docBase="../../../../../../portlet/dashboard/src/main/webapp"
 				 debug="0" reloadable="true" />
\ No newline at end of file

Modified: portal/trunk/portlet/exoadmin/src/main/resources/tomcat/exoadmin.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/resources/tomcat/exoadmin.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/portlet/exoadmin/src/main/resources/tomcat/exoadmin.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,5 +19,5 @@
 
 -->
 
-<Context path="/exoadmin" docBase="../../../eXoProjects/portal/trunk/portlet/exoadmin/src/main/webapp" 
+<Context path="/exoadmin" docBase="../../../../../../portlet/exoadmin/src/main/webapp" 
          debug="0" reloadable="true" />

Modified: portal/trunk/portlet/web/src/main/resources/tomcat/web.xml
===================================================================
--- portal/trunk/portlet/web/src/main/resources/tomcat/web.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/portlet/web/src/main/resources/tomcat/web.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,5 +19,5 @@
 
 -->
 
-<Context path="/web" docBase="../../../eXoProjects/portal/trunk/portlet/web/src/main/webapp" 
+<Context path="/web" docBase="../../../../../../portlet/web/src/main/webapp" 
          debug="0" reloadable="true" />

Modified: portal/trunk/testsuite/webuibasedsamples/src/main/resources/tomcat/portlets.xml
===================================================================
--- portal/trunk/testsuite/webuibasedsamples/src/main/resources/tomcat/portlets.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/testsuite/webuibasedsamples/src/main/resources/tomcat/portlets.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,2 +1,2 @@
-<Context path="/portlets" docBase="../../../eXoProjects/portal/trunk/sample/portlets/src/main/webapp"
+<Context path="/portlets" docBase="../../../../../../sample/portlets/src/main/webapp"
 				 debug="0" reloadable="true" />

Modified: portal/trunk/web/eXoResources/src/main/resources/tomcat/eXoResources.xml
===================================================================
--- portal/trunk/web/eXoResources/src/main/resources/tomcat/eXoResources.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/eXoResources/src/main/resources/tomcat/eXoResources.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -19,5 +19,5 @@
 
 -->
 
-<Context path="/eXoResources" docBase="../../../../../web/eXoResources/src/main/webapp" 
+<Context path="/eXoResources" docBase="../../../../../../web/eXoResources/src/main/webapp" 
          debug="0" reloadable="true" />

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-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-12-08 03:37:31 UTC (rev 5502)
@@ -53,7 +53,7 @@
   	var PortalDragDrop = eXo.portal.PortalDragDrop ;
     this.origDragObjectStyle = new eXo.core.HashMap() ;
     var dragObject = dndEvent.dragObject ;
-    var properties = ["top", eXo.core.I18n.isLT() ? "left" : "right", "zIndex", "opacity", "filter", "position"] ;
+    var properties = ["top", eXo.core.I18n.isLT() ? "left" : "right", "zIndex", "opacity", "filter", "position", "width"] ;
     this.origDragObjectStyle.copyProperties(properties, dragObject.style) ;
     
     var isAddingNewly = !DOMUtil.findFirstDescendantByClass(dragObject, "div", "UIComponentBlock");
@@ -73,6 +73,8 @@
     } 
 		
     PortalDragDrop.parentDragObject = dragObject.parentNode ;
+    //use this when press ESC with firefox (cancel dragdrop in column container)
+    PortalDragDrop.backupParentSibling = DOMUtil.findNextElementByTagName(dragObject.parentNode, "td");
     PortalDragDrop.backupDragObjectWidth = dragObject.offsetWidth ;
         
     /*Case: dragObject out of UIPortal*/
@@ -150,11 +152,6 @@
     eXo.portal.PortalDragDrop.layoutTypeElementNode = layoutTypeElement ;
     
     if(previewBlock == null) previewBlock = eXo.portal.PortalDragDrop.createPreview();
-    if(previewTD || document.getElementById("PreviewTDBlock")) {
-    	if(!previewTD) previewTD = document.getElementById("PreviewTDBlock");
-    	if(previewTD.parentNode) previewTD.parentNode.removeChild(previewTD);
-    	previewTD = null;
-    }
     
     if(layoutTypeElement != null && !DOMUtil.hasClass(layoutTypeElement, "UITableColumnContainer")) {
       /* ===============================CASE ROW LAYOUT================================ */
@@ -190,8 +187,6 @@
         	var td = tdElementList[i];
           if((td != previewBlock.parentNode) && (td != dragObject.parentNode)) {
             listComponent.push(td) ;
-          } else if(td == dragObject.parentNode) {
-          	td.style.width = "0px";
           }
         } else {
           listComponent.push(tdElementList[i]) ;
@@ -203,13 +198,10 @@
       dndEvent.foundTargetObject.foundIndex = insertPosition ;
       
       /* Insert preview block */
-      previewTD = document.createElement("td");
-      previewTD.id = previewTD.className = "PreviewTDBlock";
-      previewTD.appendChild(previewBlock);
       if(insertPosition >= 0) {
-        trContainer.insertBefore(previewTD, listComponent[insertPosition]) ;
+        trContainer.insertBefore(dragObject.parentNode, listComponent[insertPosition]) ;
       } else {
-        trContainer.appendChild(previewTD) ;
+        trContainer.appendChild(dragObject.parentNode) ;
       }
     }
      var dragParent = dragObject.parentNode;
@@ -219,11 +211,9 @@
   } ;
 
   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()) {
+  	//When press esc key, we want to cancel the dragdrop
+  	if (dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode == 27) {
   		hasChanged = false;
   	}
   	//When dragObject is outside 
@@ -231,38 +221,48 @@
   	   dndEvent.foundTargetObject = dndEvent.lastFoundTargetObject;
   	}
   	
-	var targetElement = dndEvent.foundTargetObject;  
-	if(!targetElement || targetElement.foundIndex == null) {
-	   hasChanged = false;
-	}
-	//When dragobject is next to preview object (position is not changed)
+    var targetElement = dndEvent.foundTargetObject;
+    if(!targetElement || targetElement.foundIndex == null) {
+       hasChanged = false;
+    }
+//	 Case RowContainer : When dragobject is next to preview object (position is not changed)
+//    Case ColumnContainer : When dragObject.parent's lastSibling doesn't change
+    var DOMUtil = eXo.core.DOMUtil;
   	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.dragObject.parentNode.tagName.toLowerCase() == "td") {
+        //Column Container
+        var backupParentSibling = eXo.portal.PortalDragDrop.backupParentSibling; 
+        if (DOMUtil.findNextElementByTagName(dndEvent.dragObject.parentNode, "td") == backupParentSibling) {
+          hasChanged = false;          
+        }
+      } else {
+        //RowContainer
+        var tempObj = DOMUtil.findNextElementByTagName(dndEvent.dragObject,  "div");
+        if (tempObj != null && tempObj.className == "DragAndDropPreview") {
+          hasChanged = false;
+        } else {
+          tempObj = DOMUtil.findPreviousElementByTagName(dndEvent.dragObject,  "div");
+          if (tempObj != null && tempObj.className == "DragAndDropPreview") {
+            hasChanged = false;
+          }
+        }
+      }
   	}
 
     if(dndEvent.backupMouseEvent && dndEvent.backupMouseEvent.keyCode != 27) {
     	eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
     } else {
-			if(dndEvent.dragObject.parentNode.nodeName.toLowerCase() == "td") {
-				dndEvent.dragObject.parentNode.style.width = "auto";
-			}
+      //When click ESC, restore dragObject's last position
+      if (dndEvent.dragObject.parentNode && dndEvent.dragObject.parentNode.tagName.toLowerCase() == "td") {
+        var tdNode = dndEvent.dragObject.parentNode ;
+        var lastSibling = eXo.portal.PortalDragDrop.backupParentSibling;
+        if (lastSibling == null) {
+          tdNode.parentNode.appendChild(tdNode);
+        } else {
+          tdNode.parentNode.insertBefore(tdNode, lastSibling);
+        }
+      }
+      
       if(dndEvent.dragObject.isAddingNewly) {
 				dndEvent.dragObject.parentNode.removeChild(dndEvent.dragObject) ;
 			}
@@ -275,15 +275,16 @@
     }
     
     if(previewBlock) previewBlock.parentNode.removeChild(previewBlock);
-    if(previewTD) previewTD.parentNode.removeChild(previewTD);
-    previewBlock = previewTD = null;
+    previewBlock = null;
     
     eXo.portal.isInDragging = false;
     if (hasChanged) {
     	eXo.portal.UIPortal.changeComposerSaveButton();
     }
-		// fix bug WEBOS-196	
-		dndEvent.dragObject.style.width = "auto" ; 
+
+    // fix bug WEBOS-196
+//		dndEvent.dragObject.style.width = "auto" ;
+    this.origDragObjectStyle.setProperties(dndEvent.dragObject.style, false) ;
   };
   
   var clickObject = this;
@@ -326,9 +327,6 @@
   if(!srcElement.isAddingNewly && (targetElement.foundIndex != null)) {
     if(eXo.portal.PortalDragDrop.layoutTypeElementNode != null) {
       eXo.portal.PortalDragDrop.divRowContainerAddChild(srcElement, targetElement, targetElement.foundIndex) ;
-    } else {
-    	eXo.portal.PortalDragDrop.parentDragObject.style.width = "auto";
-      eXo.portal.PortalDragDrop.tableColumnContainerAddChild(srcElement, targetElement, targetElement.foundIndex) ;
     }
   }
 
@@ -366,6 +364,7 @@
     dropableTargets.push(uiTableContainer);
     return dropableTargets;
   }
+
   var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
   var pagebody = document.getElementById("UIPageBody");
   if(eXo.portal.portalMode && pagebody) {
@@ -381,6 +380,7 @@
   	if(DOMUtil.hasAncestor(uiContainers[i], dragBlock)) continue;
   	if(DOMUtil.hasClass(uiContainers[i], "ProtectedContainer")) continue;
   	if (DOMUtil.hasClass(uiContainers[i], "UITableColumnContainer")) continue;
+
     dropableTargets.push(uiContainers[i]) ;
   }
   return dropableTargets ;
@@ -471,29 +471,4 @@
   }
 };
 
-/**
- * Add the <code>srcElement</code> to be a column of the <code>targetElement</code> table column container
- * at the position <code>insertPosition</code>
- */
-PortalDragDrop.prototype.tableColumnContainerAddChild = function(srcElement, targetElement, insertPosition) {
-  var listComponent = eXo.core.DragDrop.dndEvent.foundTargetObject.listComponentInTarget ;
-  var DOMUtil = eXo.core.DOMUtil ;
-  var trContainer = DOMUtil.findFirstDescendantByClass(targetElement, "tr", "TRContainer") ;
-  
-  var tdInserted = document.createElement('td') ;
-  tdInserted.appendChild(srcElement) ;
-  
-  if(insertPosition >= 0) {
-    trContainer.insertBefore(tdInserted, listComponent[insertPosition]) ;
-  } else {
-    trContainer.appendChild(tdInserted) ;
-  }
-
-  srcElement.style.width = "auto" ;
-  
-	if(eXo.portal.PortalDragDrop.parentDragObject.nodeName.toLowerCase() == "td") {
-    DOMUtil.removeElement(eXo.portal.PortalDragDrop.parentDragObject) ;
-  }
-};
-
 eXo.portal.PortalDragDrop = new PortalDragDrop() ;
\ No newline at end of file

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js	2010-12-08 03:37:31 UTC (rev 5502)
@@ -516,10 +516,10 @@
   var parent;
   if (parent = DOMUtil.findAncestorByClass(element, "UIPortlet")) {
     return parent;
+  } else if (parent = DOMUtil.findAncestorByClass(element, "UIPageBody")) {
+     return parent;
   } else if (parent = DOMUtil.findAncestorByClass(element, "UIContainer")) {
     return parent;
-  } else if (parent = DOMUtil.findAncestorByClass(element, "UIPageBody")) {
-    return parent;
   } else if (parent = DOMUtil.findAncestorByClass(element, "UIPortal")) {
     return parent;
   }
@@ -611,7 +611,12 @@
 UIPortal.prototype.removeComponent = function(componentId) {
 		var comp = document.getElementById(componentId);
 		var viewPage = eXo.core.DOMUtil.findAncestorByClass(comp, "VIEW-PAGE");
-		
+
+		var parent = comp.parentNode;
+		if (eXo.core.DOMUtil.getChildrenByTagName(parent, "div").length === 1 && !eXo.core.DOMUtil.hasClass(parent, "EmptyContainer")) {
+			eXo.core.DOMUtil.addClass(parent, "EmptyContainer");
+		}
+
 		//Check if the removing component is a column
 		if (comp.parentNode.nodeName.toUpperCase() == "TD") eXo.core.DOMUtil.removeElement(comp.parentNode);
 		else eXo.core.DOMUtil.removeElement(comp);

Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIForm.js	2010-12-08 03:37:31 UTC (rev 5502)
@@ -144,6 +144,11 @@
         break; 
           
       case "checkbox":
+        if(element.checked) 
+            this.addField(element.name, "true");
+        else
+            this.addField(element.name, "false");
+        break;
       case "radio":
         if(element.checked) this.addField(element.name, element.value);  
         break;  

Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -237,7 +237,7 @@
                <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/wsrp${container.name.suffix}"/>
              </properties>
              <value-storages>
-               <value-storage id="gadgets"
+               <value-storage id="wsrp-system"
                   class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
                  <properties>
                    <property name="path" value="${gatein.jcr.storage.data.dir}/wsrp${container.name.suffix}"/>
@@ -304,7 +304,7 @@
                   <property name="swap-directory" value="${gatein.jcr.data.dir}/swap/pc${container.name.suffix}"/>
                </properties>
                <value-storages>
-                  <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+                  <value-storage id="pc-system" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
                      <properties>
                         <property name="path" value="${gatein.jcr.storage.data.dir}/pc${container.name.suffix}"/>
                      </properties>

Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy	2010-12-08 03:37:31 UTC (rev 5502)
@@ -70,22 +70,22 @@
     autofitColumn.addSelectItemOption(new SelectItemOption("autofitOneColumns","" +
         "<container template=\"system:/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl\">" +
         "  <factory-id>TableColumnContainer</factory-id>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
         "</container>", 
         "OneRowContainerLayout")) ;
     autofitColumn.addSelectItemOption(new SelectItemOption("autofitTwoColumns",
         "<container template=\"system:/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl\">" +
         "  <factory-id>TableColumnContainer</factory-id>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
         "</container>",
         "TwoColumnContainerLayout")) ;
     autofitColumn.addSelectItemOption(new SelectItemOption("autofitThreeColumns",
         "<container template=\"system:/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl\">" +
         "  <factory-id>TableColumnContainer</factory-id>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
         "</container>",
         "ThreeColumnContainerLayout")) ;
   templates.add(autofitColumn);  

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl	2010-12-08 03:37:31 UTC (rev 5502)
@@ -42,10 +42,10 @@
 				<div class="VIEW-CONTAINER VIEW-BLOCK">
 			<%} %> 
 					<%if(hasPermission) {%>
-						<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
-							<div>
+						<div>
+						  <div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
 								<%uicomponent.renderChildren();%>
-							</div>
+						  </div>
 						</div>
 						<%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
 				</div>

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-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	2010-12-08 03:37:31 UTC (rev 5502)
@@ -16,7 +16,7 @@
 	}
 	
 %>
-<div class="UIContainer <%=uiPortalApp.isEditing()?"EdittingContainer":""%> <%=hasPermission?"":"ProtectedContainer"%>" 
+<div class="UIContainer UITableColumnContainer <%=uiPortalApp.isEditing()?"EdittingContainer":""%> <%=hasPermission?"":"ProtectedContainer"%>" 
 				id="${uicomponent.id}" 
 				onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);" 
 				onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
@@ -39,10 +39,10 @@
 				<%} %>
 					<div>
 						<%if(hasPermission) {%>		
-						<table class="UITableColumnContainer" style="margin: 0px auto; $style">
+						<table class="UITableColumn" margin: 0px auto; $style">
 							<tr class="TRContainer">
 								<% for(uiChild in uicomponent.getChildren()) {%>
-									<td class="${uiChild.id}TDContainer TDContainer"><% uicomponent.renderUIComponent(uiChild) %></td>
+									<td class="${uiChild.id}TDContainer" <% if(uiChild.getWidth()) { %> width="<%= uiChild.getWidth(); %>" <% } %>><% uicomponent.renderUIComponent(uiChild) %></td>
 								<% } %>
 						 </tr>
 						</table>
@@ -65,16 +65,16 @@
 											<div class="RightBar">
 												<div class="MiddleBar">
 													<div class="FixHeight ClearFix">
-														<div class="DragControlArea" title="<%=_ctx.appRes("UIContainer.tooltip.drag")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
+														<div class="DragControlArea" title="<%=_ctx.appRes("UITableColumnContainer.title.DragControlArea")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
 														<% 
 															String strTitle = uicomponent.getTitle() != null ?
 																		ExpressionUtil.getExpressionValue(res, uicomponent.getTitle()) :
-																		_ctx.appRes("UIContainer.title.Container");
+																		_ctx.appRes("UITableColumnContainer.title.Container");
 														%>
 														<div class="ContainerIcon DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
 														<%if(hasPermission) {%>
-															<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>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>" class="EditContainerIcon" title="<%=_ctx.appRes("UITableColumnContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UITableColumnContainer.tooltip.closeContainer")%>"><span></span></a>
 														<%}%>
 													</div>
 												</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-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-12-08 03:37:31 UTC (rev 5502)
@@ -42,7 +42,7 @@
 						<table class="UITableColumn" style="table-layout: fixed; margin: 0px auto; $style">
 							<tr class="TRContainer">
 								<% for(uiChild in uicomponent.getChildren()) {%>
-									<td class="${uiChild.id}TDContainer TDContainer" width="<%= uiChild.getWidth(); %>"><% uicomponent.renderUIComponent(uiChild) %></td>
+									<td class="${uiChild.id}TDContainer" <% if(uiChild.getWidth()) { %> width="<%= uiChild.getWidth(); %>" <% } %>><% uicomponent.renderUIComponent(uiChild) %></td>
 								<% } %>
 						 </tr>
 						</table>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortletForm.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortletForm.gtmpl	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortletForm.gtmpl	2010-12-08 03:37:31 UTC (rev 5502)
@@ -25,7 +25,7 @@
 										<div class="$className">
 											<div class="LeftTab">
 												<div class="RightTab">
-													<div class="MiddleTab" onmousedown="eXo.UIPortletForm.hideSaveButton(this)" onclick="eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, '$uiform.id', 'EditMode');$actionLink"><%= _ctx.appRes("UIPortletForm.tab.label.EditMode") %></div>
+													<div class="MiddleTab" onclick="eXo.UIPortletForm.hideSaveButton(this); eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, '$uiform.id', 'EditMode');$actionLink"><%= _ctx.appRes("UIPortletForm.tab.label.EditMode") %></div>
 												</div>
 											</div>
 										</div>
@@ -44,7 +44,7 @@
 										<div class="$className">
 											<div class="LeftTab">
 												<div class="RightTab">
-													<div class="MiddleTab" onmousedown="eXo.UIPortletForm.showSaveButton(this)" onclick="eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, '$uiform.id', '$inputSet.id');$actionLink">$tabName</div>
+													<div class="MiddleTab" onclick="eXo.UIPortletForm.showSaveButton(this); eXo.webui.UIHorizontalTabs.changeTabForUIFormTabpane(this, '$uiform.id', '$inputSet.id');$actionLink">$tabName</div>
 												</div>
 											</div>
 										</div>

Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/organization/account/UIUserSelector.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/organization/account/UIUserSelector.gtmpl	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/organization/account/UIUserSelector.gtmpl	2010-12-08 03:37:31 UTC (rev 5502)
@@ -58,7 +58,7 @@
 						<thead>
 							<tr>
 								<% if(isMulti) {%>
-								<th style="width: 30px;"><input type="checkbox" class="checkbox" value="4" /></th>
+								<th style="width: 30px;"><input type="checkbox" class="checkbox" name="selectall"/></th>
 								<% } %>
 								<th>
 									<%=uiform.getLabel('userName')%>

Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -114,13 +114,16 @@
    {
       if (!isEnable())
          return;
-      if (input == null)
-         checked = false;
-      else
-         checked = true;
-      if (typeValue_ == Boolean.class || typeValue_ == boolean.class)
-      {
-         value_ = typeValue_.cast(checked);
+      
+      if (input != null) {
+         if(input.equals("true"))
+            checked = true;
+         else
+            checked = false;
+         if (typeValue_ == Boolean.class || typeValue_ == boolean.class)
+         {
+            value_ = typeValue_.cast(checked);
+         }
       }
    }
 

Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIUserProfileInputSet.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -121,6 +121,7 @@
             initLanguageCombo(langSelectBox);
             continue;
          }
+         
          set.addUIFormInput(new UIFormStringInput(key, null, null));
       }
    }

Modified: portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java
===================================================================
--- portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/framework/src/main/java/org/exoplatform/webui/config/Component.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -56,7 +56,8 @@
 
    private final List<EventInterceptor> eventInterceptors;
 
-   private Map<String, Event> eventMap;
+   /** Declare this map as volatile to make double-check work properly **/
+   private volatile Map<String, Event> eventMap;
 
    private Lifecycle<UIComponent> componentLifecycle;
 
@@ -182,18 +183,21 @@
          {
             if(eventMap == null)
             {
-               eventMap = new HashMap<String, Event>();
+               Map<String, Event> temporaryMap = new HashMap<String, Event>();
 
                if (events == null)
                {
+                  eventMap = temporaryMap;
                   return null;
                }
 
                for (Event event : events)
                {
                   createCachedEventListeners(event);
-                  eventMap.put(event.getName(), event);
+                  temporaryMap.put(event.getName(), event);
                }
+               
+               eventMap = temporaryMap;
             }
             
             return eventMap.get(eventName);

Modified: portal/trunk/webui/portal/pom.xml
===================================================================
--- portal/trunk/webui/portal/pom.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/portal/pom.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -92,5 +92,12 @@
       <groupId>org.gatein.captcha</groupId>
       <artifactId>simplecaptcha</artifactId>
     </dependency>
+    
+    <dependency>
+      <groupId>org.exoplatform.portal</groupId>
+      <artifactId>exo.portal.component.test.core</artifactId>
+      <scope>test</scope>
+    </dependency>
+    
   </dependencies>
 </project>

Copied: portal/trunk/webui/portal/src/test (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test)

Copied: portal/trunk/webui/portal/src/test/java (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java)

Copied: portal/trunk/webui/portal/src/test/java/org (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org)

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform)

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal)

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui)

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test)

Deleted: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,122 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat                                               *
- * Copyright 2010, Red Hat Middleware, LLC, and individual                    *
- * contributors as indicated by the @authors tag. See the                     *
- * copyright.txt in the distribution for a full listing of                    *
- * individual contributors.                                                   *
- *                                                                            *
- * This is free software; you can redistribute it and/or modify it            *
- * under the terms of the GNU Lesser General Public License as                *
- * published by the Free Software Foundation; either version 2.1 of           *
- * the License, or (at your option) any later version.                        *
- *                                                                            *
- * This software is distributed in the hope that it will be useful,           *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
- * Lesser General Public License for more details.                            *
- *                                                                            *
- * You should have received a copy of the GNU Lesser General Public           *
- * License along with this software; if not, write to the Free                *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
- ******************************************************************************/
-package org.exoplatform.portal.webui.test;
-
-import java.io.File;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.exoplatform.portal.webui.portal.PageNodeEvent;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.webui.config.Event;
-
-import org.exoplatform.component.test.AbstractGateInTest;
-
-/**
- * Unit test for concurrent read of event from UI component configuration.
- * 
- * @author <a href="mailto:mposolda at redhat.com">Marek Posolda</a>
- * @version $Revision$
- */
-public class ComponentConfigConcurrentTest extends AbstractGateInTest 
-{
-	private static final int WORKERS_COUNT = 50;
-	
-	private MockApplication mockApplication;
-	
-	public void testConcurrentReadOfComponentEventConfig() throws Exception 
-	{
-		// Init configuration and mock WebUI application
-		Map<String, String> initParams = new HashMap<String, String>();
-		initParams.put("webui.configuration", "webui.configuration");
-
-		String basedir = System.getProperty("basedir");
-		String webuiConfig = basedir + "/src/test/resources/webui-configuration.xml";
-		Map<String, URL> resources = new HashMap<String, URL>();
-		resources.put("webui.configuration", new File(webuiConfig).toURI().toURL());
-		initParams.put("webui.configuration", new File(webuiConfig).toURI().toURL().toString());
-
-		mockApplication = new MockApplication(initParams, resources, null);
-		mockApplication.onInit();
-		
-		// init workers list
-		List<Worker> workers = new ArrayList<Worker>(WORKERS_COUNT);
-		
-		// test obtain event configuration concurrently with more worker threads
-		for (int i=0 ; i<WORKERS_COUNT ; i++)
-		{
-			Worker worker = new Worker("Worker-" + i);			
-			workers.add(worker);
-			worker.start();
-		}	
-		
-		// Wait for all workers to finish
-		for (Worker worker : workers)
-		{
-			worker.join();
-		}
-		
-		// Go throguh all workers and throw error if some worker has null eventConfig
-		for (Worker worker : workers)
-		{
-			assertNotNull("event configuration is null in worker " + worker.getName(), worker.eventConfig);
-		}		
-
-		// destroy mock application
-		mockApplication.onDestroy();
-	}
-	
-	private class Worker extends Thread
-	{
-		private Event eventConfig = null;
-		
-		public Worker(String name)
-		{
-			super(name);
-		}
-		
-		public void run()
-		{			
-			try
-			{
-				UIPortal uiPortal = mockApplication.createUIComponent(UIPortal.class, null, null, null);
-				eventConfig = uiPortal.getComponentConfig().getUIComponentEventConfig(PageNodeEvent.CHANGE_PAGE_NODE);
-				
-				// log message now if eventConfig is null, so that we know about all failed workers. Test will be failed later.
-				if (eventConfig == null)
-				{
-					log.error("eventConfig is null for worker " + getName());
-				}
-			}
-			catch (Exception e)
-			{
-				log.error("Exception occured during concurrent test in worker " + getName(), e);				
-			}			
-		}		
-		
-	}
-
-}

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java)
===================================================================
--- portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java	                        (rev 0)
+++ portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/ComponentConfigConcurrentTest.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2010, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.exoplatform.portal.webui.test;
+
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.exoplatform.portal.webui.portal.PageNodeEvent;
+import org.exoplatform.portal.webui.portal.UIPortal;
+import org.exoplatform.webui.config.Event;
+
+import org.exoplatform.component.test.AbstractGateInTest;
+
+/**
+ * Unit test for concurrent read of event from UI component configuration.
+ * 
+ * @author <a href="mailto:mposolda at redhat.com">Marek Posolda</a>
+ * @version $Revision$
+ */
+public class ComponentConfigConcurrentTest extends AbstractGateInTest 
+{
+	private static final int WORKERS_COUNT = 50;
+	
+	private MockApplication mockApplication;
+	
+	public void testConcurrentReadOfComponentEventConfig() throws Exception 
+	{
+		// Init configuration and mock WebUI application
+		Map<String, String> initParams = new HashMap<String, String>();
+		initParams.put("webui.configuration", "webui.configuration");
+
+		String basedir = System.getProperty("basedir");
+		String webuiConfig = basedir + "/src/test/resources/webui-configuration.xml";
+		Map<String, URL> resources = new HashMap<String, URL>();
+		resources.put("webui.configuration", new File(webuiConfig).toURI().toURL());
+		initParams.put("webui.configuration", new File(webuiConfig).toURI().toURL().toString());
+
+		mockApplication = new MockApplication(initParams, resources, null);
+		mockApplication.onInit();
+		
+		// init workers list
+		List<Worker> workers = new ArrayList<Worker>(WORKERS_COUNT);
+		
+		// test obtain event configuration concurrently with more worker threads
+		for (int i=0 ; i<WORKERS_COUNT ; i++)
+		{
+			Worker worker = new Worker("Worker-" + i);			
+			workers.add(worker);
+			worker.start();
+		}	
+		
+		// Wait for all workers to finish
+		for (Worker worker : workers)
+		{
+			worker.join();
+		}
+		
+		// Go throguh all workers and throw error if some worker has null eventConfig
+		for (Worker worker : workers)
+		{
+			assertNotNull("event configuration is null in worker " + worker.getName(), worker.eventConfig);
+		}		
+
+		// destroy mock application
+		mockApplication.onDestroy();
+	}
+	
+	private class Worker extends Thread
+	{
+		private Event eventConfig = null;
+		
+		public Worker(String name)
+		{
+			super(name);
+		}
+		
+		public void run()
+		{			
+			try
+			{
+				UIPortal uiPortal = mockApplication.createUIComponent(UIPortal.class, null, null, null);
+				eventConfig = uiPortal.getComponentConfig().getUIComponentEventConfig(PageNodeEvent.CHANGE_PAGE_NODE);
+				
+				// log message now if eventConfig is null, so that we know about all failed workers. Test will be failed later.
+				if (eventConfig == null)
+				{
+					log.error("eventConfig is null for worker " + getName());
+				}
+			}
+			catch (Exception e)
+			{
+				log.error("Exception occured during concurrent test in worker " + getName(), e);				
+			}			
+		}		
+		
+	}
+
+}

Deleted: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,98 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- * 
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- * 
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.portal.webui.test;
-
-import java.net.URL;
-import java.util.Locale;
-import java.util.Map;
-import java.util.ResourceBundle;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.portal.application.PortalStateManager;
-import org.exoplatform.portal.webui.portal.UIPortal;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.resolver.ApplicationResourceResolver;
-import org.exoplatform.resolver.MockResourceResolver;
-import org.exoplatform.webui.application.WebuiApplication;
-
-public class MockApplication extends WebuiApplication
-{
-
-   private Map<String, String> initParams_;
-
-   private ResourceBundle appRes_;
-
-   public MockApplication(Map<String, String> initParams, Map<String, URL> resources, ResourceBundle appRes)
-   {
-      initParams_ = initParams;
-      appRes_ = appRes;
-      ApplicationResourceResolver resolver = new ApplicationResourceResolver();
-      resolver.addResourceResolver(new MockResourceResolver(resources));
-      setResourceResolver(resolver);
-   }
-
-   public String getApplicationId()
-   {
-      return "MockApplication";
-   }
-
-   public String getApplicationName()
-   {
-      return "MockApplication";
-   }
-
-   @SuppressWarnings("unused")
-   public ResourceBundle getResourceBundle(Locale locale) throws Exception
-   {
-      return appRes_;
-   }
-
-   @SuppressWarnings("unused")
-   public ResourceBundle getOwnerResourceBundle(String username, Locale locale) throws Exception
-   {
-      return null;
-   }
-
-   public String getApplicationInitParam(String name)
-   {
-      return initParams_.get(name);
-   }
-
-   @Override
-   public ExoContainer getApplicationServiceContainer()
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-
-   @Override
-   public String getApplicationGroup()
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-
-   @Override
-   public String getApplicationType()
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-}

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java)
===================================================================
--- portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java	                        (rev 0)
+++ portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockApplication.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,98 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ * 
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.webui.test;
+
+import java.net.URL;
+import java.util.Locale;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.portal.application.PortalStateManager;
+import org.exoplatform.portal.webui.portal.UIPortal;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.resolver.ApplicationResourceResolver;
+import org.exoplatform.resolver.MockResourceResolver;
+import org.exoplatform.webui.application.WebuiApplication;
+
+public class MockApplication extends WebuiApplication
+{
+
+   private Map<String, String> initParams_;
+
+   private ResourceBundle appRes_;
+
+   public MockApplication(Map<String, String> initParams, Map<String, URL> resources, ResourceBundle appRes)
+   {
+      initParams_ = initParams;
+      appRes_ = appRes;
+      ApplicationResourceResolver resolver = new ApplicationResourceResolver();
+      resolver.addResourceResolver(new MockResourceResolver(resources));
+      setResourceResolver(resolver);
+   }
+
+   public String getApplicationId()
+   {
+      return "MockApplication";
+   }
+
+   public String getApplicationName()
+   {
+      return "MockApplication";
+   }
+
+   @SuppressWarnings("unused")
+   public ResourceBundle getResourceBundle(Locale locale) throws Exception
+   {
+      return appRes_;
+   }
+
+   @SuppressWarnings("unused")
+   public ResourceBundle getOwnerResourceBundle(String username, Locale locale) throws Exception
+   {
+      return null;
+   }
+
+   public String getApplicationInitParam(String name)
+   {
+      return initParams_.get(name);
+   }
+
+   @Override
+   public ExoContainer getApplicationServiceContainer()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public String getApplicationGroup()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+
+   @Override
+   public String getApplicationType()
+   {
+      // TODO Auto-generated method stub
+      return null;
+   }
+}

Deleted: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,46 +0,0 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
- * 
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- * 
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.exoplatform.portal.webui.test;
-
-import org.exoplatform.webui.application.StateManager;
-import org.exoplatform.webui.application.WebuiApplication;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.core.UIApplication;
-
-public class MockStateManager extends StateManager
-{
-
-   @SuppressWarnings("unused")
-   public UIApplication restoreUIRootComponent(WebuiRequestContext context)
-   {
-      return null;
-   }
-
-   @SuppressWarnings("unused")
-   public void storeUIRootComponent(WebuiRequestContext context)
-   {
-   }
-
-   @SuppressWarnings("unused")
-   public void expire(String sessionId, WebuiApplication app)
-   {
-
-   }
-}

Copied: portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java)
===================================================================
--- portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java	                        (rev 0)
+++ portal/trunk/webui/portal/src/test/java/org/exoplatform/portal/webui/test/MockStateManager.java	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,46 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ * 
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.portal.webui.test;
+
+import org.exoplatform.webui.application.StateManager;
+import org.exoplatform.webui.application.WebuiApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.core.UIApplication;
+
+public class MockStateManager extends StateManager
+{
+
+   @SuppressWarnings("unused")
+   public UIApplication restoreUIRootComponent(WebuiRequestContext context)
+   {
+      return null;
+   }
+
+   @SuppressWarnings("unused")
+   public void storeUIRootComponent(WebuiRequestContext context)
+   {
+   }
+
+   @SuppressWarnings("unused")
+   public void expire(String sessionId, WebuiApplication app)
+   {
+
+   }
+}

Copied: portal/trunk/webui/portal/src/test/resources (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources)

Copied: portal/trunk/webui/portal/src/test/resources/conf (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources/conf)

Copied: portal/trunk/webui/portal/src/test/resources/conf/portal (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources/conf/portal)

Deleted: portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources/conf/portal/test-configuration.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
-    Copyright (C) 2009 eXo Platform SAS.
-    
-    This is free software; you can redistribute it and/or modify it
-    under the terms of the GNU Lesser General Public License as
-    published by the Free Software Foundation; either version 2.1 of
-    the License, or (at your option) any later version.
-    
-    This software is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-    Lesser General Public License for more details.
-    
-    You should have received a copy of the GNU Lesser General Public
-    License along with this software; if not, write to the Free
-    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-    02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-
-<configuration
-   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-   xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-</configuration>

Copied: portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources/conf/portal/test-configuration.xml)
===================================================================
--- portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml	                        (rev 0)
+++ portal/trunk/webui/portal/src/test/resources/conf/portal/test-configuration.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright (C) 2009 eXo Platform SAS.
+    
+    This is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Lesser General Public License as
+    published by the Free Software Foundation; either version 2.1 of
+    the License, or (at your option) any later version.
+    
+    This software is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+    Lesser General Public License for more details.
+    
+    You should have received a copy of the GNU Lesser General Public
+    License along with this software; if not, write to the Free
+    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+    02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<configuration
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+   xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+</configuration>

Deleted: portal/trunk/webui/portal/src/test/resources/webui-configuration.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources/webui-configuration.xml	2010-12-07 14:58:26 UTC (rev 5501)
+++ portal/trunk/webui/portal/src/test/resources/webui-configuration.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -1,37 +0,0 @@
-<!--
-
-    Copyright (C) 2009 eXo Platform SAS.
-    
-    This is free software; you can redistribute it and/or modify it
-    under the terms of the GNU Lesser General Public License as
-    published by the Free Software Foundation; either version 2.1 of
-    the License, or (at your option) any later version.
-    
-    This software is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-    Lesser General Public License for more details.
-    
-    You should have received a copy of the GNU Lesser General Public
-    License along with this software; if not, write to the Free
-    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-    02110-1301 USA, or see the FSF site: http://www.fsf.org.
-
--->
-
-<webui-configuration>  
-  <application>     
-    <init-params>
-    </init-params>
-
-    <ui-component-root>org.exoplatform.portal.webui.workspace.UIPortalApplication</ui-component-root>    
-    <state-manager>org.exoplatform.portal.webui.test.MockStateManager</state-manager>
-
-    <application-lifecycle-listeners>       
-      <listener>org.exoplatform.webui.application.MonitorApplicationLifecycle</listener>      
-    </application-lifecycle-listeners>
-
-    <events>
-    </events>
-  </application>
-</webui-configuration>

Copied: portal/trunk/webui/portal/src/test/resources/webui-configuration.xml (from rev 5501, portal/branches/branch-GTNPORTAL-1700/webui/portal/src/test/resources/webui-configuration.xml)
===================================================================
--- portal/trunk/webui/portal/src/test/resources/webui-configuration.xml	                        (rev 0)
+++ portal/trunk/webui/portal/src/test/resources/webui-configuration.xml	2010-12-08 03:37:31 UTC (rev 5502)
@@ -0,0 +1,37 @@
+<!--
+
+    Copyright (C) 2009 eXo Platform SAS.
+    
+    This is free software; you can redistribute it and/or modify it
+    under the terms of the GNU Lesser General Public License as
+    published by the Free Software Foundation; either version 2.1 of
+    the License, or (at your option) any later version.
+    
+    This software is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+    Lesser General Public License for more details.
+    
+    You should have received a copy of the GNU Lesser General Public
+    License along with this software; if not, write to the Free
+    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+    02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<webui-configuration>  
+  <application>     
+    <init-params>
+    </init-params>
+
+    <ui-component-root>org.exoplatform.portal.webui.workspace.UIPortalApplication</ui-component-root>    
+    <state-manager>org.exoplatform.portal.webui.test.MockStateManager</state-manager>
+
+    <application-lifecycle-listeners>       
+      <listener>org.exoplatform.webui.application.MonitorApplicationLifecycle</listener>      
+    </application-lifecycle-listeners>
+
+    <events>
+    </events>
+  </application>
+</webui-configuration>



More information about the gatein-commits mailing list