[gatein-commits] gatein SVN: r577 - in portal/trunk: portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 12 05:28:30 EST 2009


Author: tan_pham_dinh
Date: 2009-11-12 05:28:30 -0500 (Thu, 12 Nov 2009)
New Revision: 577

Removed:
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml
Modified:
   portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties
   portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
   portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
GTNPORTAL-91: After merged performance branch, some code reverted and changed, fix for that. GTNPORTAL-150: Change title Organize to Categories in ApplicationPortlet

Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMDataStorage.java	2009-11-12 10:28:30 UTC (rev 577)
@@ -28,26 +28,26 @@
 import org.exoplatform.portal.config.model.ApplicationState;
 import org.exoplatform.portal.config.model.CloneApplicationState;
 import org.exoplatform.portal.config.model.Container;
-import org.exoplatform.portal.pom.data.ModelChange;
 import org.exoplatform.portal.config.model.ModelObject;
+import org.exoplatform.portal.config.model.PersistentApplicationState;
+import org.exoplatform.portal.config.model.TransientApplicationState;
 import org.exoplatform.portal.pom.config.cache.DataCache;
 import org.exoplatform.portal.pom.config.tasks.DashboardTask;
+import org.exoplatform.portal.pom.config.tasks.PageNavigationTask;
+import org.exoplatform.portal.pom.config.tasks.PageTask;
+import org.exoplatform.portal.pom.config.tasks.PortalConfigTask;
+import org.exoplatform.portal.pom.config.tasks.PortletPreferencesTask;
+import org.exoplatform.portal.pom.config.tasks.PreferencesTask;
+import org.exoplatform.portal.pom.config.tasks.SearchTask;
 import org.exoplatform.portal.pom.data.DashboardData;
+import org.exoplatform.portal.pom.data.ModelChange;
 import org.exoplatform.portal.pom.data.ModelDataStorage;
 import org.exoplatform.portal.pom.data.NavigationData;
 import org.exoplatform.portal.pom.data.NavigationKey;
 import org.exoplatform.portal.pom.data.PageData;
-import org.exoplatform.portal.config.model.PersistentApplicationState;
 import org.exoplatform.portal.pom.data.PageKey;
 import org.exoplatform.portal.pom.data.PortalData;
 import org.exoplatform.portal.pom.data.PortalKey;
-import org.exoplatform.portal.config.model.TransientApplicationState;
-import org.exoplatform.portal.pom.config.tasks.PageNavigationTask;
-import org.exoplatform.portal.pom.config.tasks.PageTask;
-import org.exoplatform.portal.pom.config.tasks.PortalConfigTask;
-import org.exoplatform.portal.pom.config.tasks.PortletPreferencesTask;
-import org.exoplatform.portal.pom.config.tasks.PreferencesTask;
-import org.exoplatform.portal.pom.config.tasks.SearchTask;
 import org.exoplatform.services.cache.CacheService;
 import org.exoplatform.services.log.ExoLogger;
 import org.exoplatform.services.log.Log;
@@ -75,7 +75,7 @@
 
    /** . */
    private final Log log = ExoLogger.getLogger(getClass());
-   
+
    /** . */
    private final TaskExecutionDecorator executor;
 
@@ -152,8 +152,7 @@
       return execute(new PageTask.Load(key)).getPage();
    }
 
-   public PageData clonePage(PageKey key, PageKey cloneKey)
-      throws Exception
+   public PageData clonePage(PageKey key, PageKey cloneKey) throws Exception
    {
       return execute(new PageTask.Clone(key, cloneKey, true)).getPage();
    }
@@ -241,7 +240,8 @@
       }
       else
       {
-         PreferencesTask.Load<S> load = new PreferencesTask.Load<S>(((PersistentApplicationState<S>)state).getStorageId());
+         PreferencesTask.Load<S> load =
+            new PreferencesTask.Load<S>(((PersistentApplicationState<S>)state).getStorageId());
          execute(load);
          return load.getState();
       }
@@ -255,8 +255,18 @@
       }
       else
       {
-         PreferencesTask.Save<S> save = new PreferencesTask.Save<S>(((PersistentApplicationState<S>)state).getStorageId(), preferences);
-         execute(save);
+         if (state instanceof PersistentApplicationState)
+         {
+            PreferencesTask.Save<S> save =
+               new PreferencesTask.Save<S>(((PersistentApplicationState<S>)state).getStorageId(), preferences);
+            execute(save);
+         }
+         else
+         {
+            PreferencesTask.Save<S> save =
+               new PreferencesTask.Save<S>(((CloneApplicationState<S>)state).getStorageId(), preferences);
+            execute(save);
+         }
          return state;
       }
    }
@@ -284,7 +294,8 @@
       }
       else if (PortletPreferences.class.equals(type))
       {
-         return (LazyPageList<T>)execute(new SearchTask.FindPortletPreferences((Query<PortletPreferences>)q)).getResult();
+         return (LazyPageList<T>)execute(new SearchTask.FindPortletPreferences((Query<PortletPreferences>)q))
+            .getResult();
       }
       else if (PortalData.class.equals(type))
       {

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ar.xml	2009-11-12 10:28:30 UTC (rev 577)
@@ -52,7 +52,7 @@
   -->
   <UIToolbar>
     <label>
-      <organize>تنظيم</organize>
+      <organize>الفئات</organize>
       <portlet>مدخل</portlet>
       <gadget>أداة</gadget>
     </label>

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.properties	2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
 application.msg.changeNotExist=Can not save changes to the application that no longer in database.
 gadget.msg.changeNotExist=Can not save changes to the gadget that no longer in database.
 ##	org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Organize
+UIToolbar.label.organize=Categories
 UIToolbar.label.portlet=Portlet
 UIToolbar.label.gadget=Gadget
 
@@ -70,7 +70,7 @@
 ##	org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
 UIAddApplicationForm.header.input=Choose
 UIAddApplicationForm.label.option.portlet=Portlet
-UIAddApplicationForm.label.option.eXoGadget=Gadget
+UIAddApplicationForm.label.option.gadget=Gadget
 UIAddApplicationForm.header.label=Display Name
 UIAddApplicationForm.header.description=Description
 UIAddApplicationForm.action.Add=Add

Deleted: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_en.xml	2009-11-12 10:28:30 UTC (rev 577)
@@ -1,283 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-
-<bundle>
-  <!--
-  ##expression
-  -->
-  <word>
-    <cancel>Cancel</cancel>
-  </word>
-  <label>
-    <displayName>Display Name:</displayName>
-    <description>Description:</description>
-  </label>
-  <category>
-    <msg>
-      <changeNotExist>Can not save changes to the category that no longer in database.</changeNotExist>
-    </msg>
-  </category>
-  <application>
-    <msg>
-      <changeNotExist>Can not save changes to the application that no longer in database.</changeNotExist>
-    </msg>
-    <label />
-  </application>
-  <gadget>
-    <msg>
-      <changeNotExist>Can not save changes to the gadget that no longer in database.</changeNotExist>
-    </msg>
-  </gadget>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-  -->
-  <UIToolbar>
-    <label>
-      <organize>Organize</organize>
-      <portlet>Portlet</portlet>
-      <gadget>Gadget</gadget>
-    </label>
-  </UIToolbar>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIApplicationOrganizer
-  -->
-  <UIOrganizer>
-    <label>
-      <addCategory>Add Category</addCategory>
-      <autoImport>Import Applications</autoImport>
-      <categories>Categories</categories>
-    </label>
-    <title>
-      <editCategory>Edit Category</editCategory>
-      <addApplication>Add application to category</addApplication>
-      <deleteCategory>Delete category</deleteCategory>
-      <deleteApplication>Delete application</deleteApplication>
-    </title>
-    <msg>
-      <importAll>This action will automatically create categories and import all the gadgets and portlets on it.</importAll>
-      <deleteCategory>Are you sure to delete this category and all applications on it?</deleteCategory>
-      <deleteApplication>Are you sure to delete this application?</deleteApplication>
-      <emptyCategory>This category does not have any application, click (+) button to add application.</emptyCategory>
-      <noCategory>There are no categories. You can click "Add Category" or "Auto Import" button to add category.</noCategory>
-      <deleteCategoryInUse>Can not delete this category, it is in use.</deleteCategoryInUse>
-      <deleteApplicationInUse>Can not delete this application, it is in use.</deleteApplicationInUse>
-      <categoryNoExist>This category is no longer in database.</categoryNoExist>
-      <applicationNoExist>This application is no longer in database.</applicationNoExist>
-    </msg>
-  </UIOrganizer>
-  
-  <!--
-  ##org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryEditMode
-  -->
-  <UIApplicationRegistryEditMode>
-  	<title>Import Applications</title>
-  	<label>
-  		<showImport>Change Show Import</showImport>
-  	</label>
-  </UIApplicationRegistryEditMode>
-  
-  <!--
-  ##org.exoplatform.applicationregistry.webui.component.UIApplicationInfo
-  -->
-  <UIPermissionForm>
-    <label>
-      <UIListPermissionSelector />
-    </label>
-  </UIPermissionForm>
-  <UIApplicationInfo>
-    <label>
-      <name>Name:</name>
-      <displayName>#{label.displayName}</displayName>
-      <description>#{label.description}</description>
-      <accessPermissions>Access Permissions</accessPermissions>
-    </label>
-    <title>
-      <editApplication>Edit Application</editApplication>
-    </title>
-  </UIApplicationInfo>
-  <!--
-  ##org.exoplatform.applicationregistry.webui.component.UIApplicationForm
-  -->
-  <UIApplicationForm>
-    <title>Edit application information</title>
-    <label>
-      <applicationName>Application Name:</applicationName>
-      <displayName>#{label.displayName}</displayName>
-      <description>#{label.description}</description>
-    </label>
-    <action>
-      <Save>#{word.save}</Save>
-      <Cancel>#{word.cancel}</Cancel>
-    </action>
-  </UIApplicationForm>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
-  -->
-  <UIAddApplicationForm>
-    <header>
-      <input>Choose</input>
-      <label>Display Name</label>
-      <description>Description</description>
-    </header>
-    <action>
-      <Add>Add</Add>
-      <Cancel>#{word.cancel}</Cancel>
-    </action>
-    <msg>
-      <PortletExist>This Application is already in category, please select another one!</PortletExist>
-    </msg>
-    <label>
-      <displayName>#{label.displayName}</displayName>
-      <type>Application Type</type>
-    </label>
-  </UIAddApplicationForm>
-  <!--
-  ##org.exoplatform.applicationregistry.webui.component.UICategoryForm
-  -->
-  <UICategoryForm>
-    <label>
-      <name>Category name:</name>
-      <displayName>#{label.displayName}</displayName>
-      <description>#{label.description}</description>
-      <UIListPermissionSelector />
-    </label>
-    <action>
-      <Save>#{word.save}</Save>
-      <Cancel>#{word.cancel}</Cancel>
-    </action>
-    <msg>
-      <SameName>This category is existing, please enter another one!</SameName>
-    </msg>
-    <tab>
-      <label>
-        <categoryPermission>Permission Setting</categoryPermission>
-        <categorySetting>Category Setting</categorySetting>
-      </label>
-    </tab>
-  </UICategoryForm>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIPortletManagement
-  -->
-  <UIPortletManagement>
-    <title>
-      <local>LOCAL</local>
-      <remote>REMOTE</remote>
-    </title>
-    <msg>
-      <noPortlet>There are no Portlets available.</noPortlet>
-    </msg>
-  </UIPortletManagement>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIPortletInfo
-  -->
-  <UIPortletInfo>
-    <label>
-      <name>Portlet Name:</name>
-      <display>#{label.displayName}</display>
-      <description>#{label.description}</description>
-    </label>
-    <title>
-      <portletPreferences>Portlet Preferences</portletPreferences>
-    </title>
-    <msg>
-      <noPortletPreferences>No Portlet Preferences</noPortletPreferences>
-    </msg>
-  </UIPortletInfo>
-  <!--
-  ##	org.exoplatform.portletregistry.webui.component.UIGadgetManagement
-  -->
-  <UIGadgetManagement>
-    <label>
-      <addRemote>Add a remote gadget</addRemote>
-      <createNew>Create a new gadget</createNew>
-    </label>
-    <title>
-      <deleteGadget>Delete Gadget</deleteGadget>
-    </title>
-    <msg>
-      <noGadget>There are no Gadgets available.</noGadget>
-      <deleteGadgetInUse>Can not delete this gadget, it is in use.</deleteGadgetInUse>
-      <deleteGadget>Are you sure to delete this gadget?</deleteGadget>
-    </msg>
-  </UIGadgetManagement>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIGadgetInfo
-  -->
-  <UIGadgetInfo>
-    <label>
-      <gadgetDetails>Gadget Details</gadgetDetails>
-      <name>Gadget name:</name>
-      <displayName>#{label.displayName}</displayName>
-      <description>#{label.description}</description>
-      <viewUrl>View URL:</viewUrl>
-      <editUrl>Edit URL:</editUrl>
-      <reference>Reference:</reference>
-    </label>
-    <title>
-      <refresh>Refresh information</refresh>
-      <editGadget>Edit Gadget</editGadget>
-      <copy>Copy this gadget to local repository</copy>
-    </title>
-    <msg>
-      <gadgetNotExist>Can not execute action on the gadget that no longer in database.</gadgetNotExist>
-    </msg>
-  </UIGadgetInfo>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIAddGadget
-  -->
-  <UIAddGadget>
-    <action>
-      <Add>Add</Add>
-      <Cancel>#{word.cancel}</Cancel>
-    </action>
-    <label>
-      <url>URL</url>
-      <urlExist>This url is existing, please select another one!</urlExist>
-      <urlError>Data in url: '{0}' is not valid</urlError>
-    </label>
-  </UIAddGadget>
-  <!--
-  ##	org.exoplatform.applicationregistry.webui.component.UIGadgetEditor
-  -->
-  <UIGadgetEditor>
-    <label>
-      <source>Source:</source>
-    </label>
-    <action>
-      <Save>#{word.save}</Save>
-      <Cancel>#{word.cancel}</Cancel>
-    </action>
-    <msg>
-      <invalidSpec>This source is invalid gadget specification.</invalidSpec>
-    </msg>
-  </UIGadgetEditor>
-  <!--
-  ##package org.exoplatform.organization.webui.component.UIListPermissionSelector
-  -->
-  <UIListPermissionSelector>
-    <header>
-      <groupId>Group</groupId>
-      <membership>Membership</membership>
-    </header>
-  </UIListPermissionSelector>
-</bundle>
-

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_es.properties	2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
 application.msg.changeNotExist=No se pueden guardar los cambios a una aplicaci\u00f3n que ya no est\u00e1 en la Base de Datos.
 gadget.msg.changeNotExist=No se pueden guardar los cambios a un gadget que ya no est\u00e1 en la Base de Datos.
 ##	org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Organizar
+UIToolbar.label.organize=Categor\u00edas
 UIToolbar.label.portlet=Portlet
 UIToolbar.label.gadget=Gadget
 
@@ -70,7 +70,7 @@
 ##	org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
 UIAddApplicationForm.header.input=Elegir
 UIAddApplicationForm.label.option.portlet=Aplicaci\u00f3n
-UIAddApplicationForm.label.option.eXoGadget=Gadget
+UIAddApplicationForm.label.option.gadget=Gadget
 UIAddApplicationForm.header.label=nombre a Visualizar
 UIAddApplicationForm.header.description=Descripci\u00f3n
 UIAddApplicationForm.action.Add=A\u00f1adir

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_ru.properties	2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
 application.msg.changeNotExist=Невозможно сохранить изменения приложения, которое удалено из базы данных.
 gadget.msg.changeNotExist=Невозможно сохранить изменения гаджета, который удален из базы данных.
 ##	org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Управление
+UIToolbar.label.organize=Категории
 UIToolbar.label.portlet=Портлет
 UIToolbar.label.gadget=Гаджет
 
@@ -71,7 +71,7 @@
 ##	org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
 UIAddApplicationForm.header.input=Выбрать
 UIAddApplicationForm.label.option.portlet=Портлет
-UIAddApplicationForm.label.option.eXoGadget=Гаджет
+UIAddApplicationForm.label.option.gadget=Гаджет
 UIAddApplicationForm.header.label=Отображаемое имя
 UIAddApplicationForm.header.description=Описание
 UIAddApplicationForm.action.Add=Добавить

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_uk.properties	2009-11-12 10:28:30 UTC (rev 577)
@@ -25,7 +25,7 @@
 application.msg.changeNotExist=Неможливо зберегти зміни, така програма не пов'язана з базою даних.
 gadget.msg.changeNotExist=Неможливо зберегти зміни, ґаджет не пов'язаний з базою даних.
 ##	org.exoplatform.applicationregistry.webui.component.UIApplicationRegistryPortlet
-UIToolbar.label.organize=Структура
+UIToolbar.label.organize=Категорії
 UIToolbar.label.portlet=Портлет
 UIToolbar.label.gadget=Ґаджет
 
@@ -71,7 +71,7 @@
 ##	org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm
 UIAddApplicationForm.header.input=Вибрати
 UIAddApplicationForm.label.option.portlet=Портлет
-UIAddApplicationForm.label.option.eXoGadget=Віджет
+UIAddApplicationForm.label.option.gadget=Віджет
 UIAddApplicationForm.header.label=Відображення імені
 UIAddApplicationForm.header.description=Опис
 UIAddApplicationForm.action.Add=Додати

Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/ApplicationRegistryPortlet_vi.xml	2009-11-12 10:28:30 UTC (rev 577)
@@ -52,7 +52,7 @@
   -->
   <UIToolbar>
     <label>
-      <organize>Tổ chức</organize>
+      <organize>Danh mục</organize>
       <portlet>Portlet</portlet>
       <gadget>Gadget</gadget>
     </label>

Deleted: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/OrganizationPortlet_en.xml	2009-11-12 10:28:30 UTC (rev 577)
@@ -1,453 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-
-<bundle>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIOrganizationPortlet
-  -->
-  <UIOrganizationPortlet>
-    <label>
-      <userManagement>User Management</userManagement>
-      <groupManagement>Group Management</groupManagement>
-      <membershipManagement>Membership Management</membershipManagement>
-    </label>
-  </UIOrganizationPortlet>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIMembershipTypeForm
-  -->
-  <UIMembershipTypeForm>
-    <title>Add/Edit Membership</title>
-    <label>
-      <name>Membership name</name>
-      <description>Description</description>
-    </label>
-    <action>
-      <Save>#{word.save}</Save>
-      <Back>#{word.back}</Back>
-      <Reset>Reset</Reset>
-    </action>
-    <msg>
-      <SameName>This membership is existing, please enter another one!</SameName>
-    </msg>
-  </UIMembershipTypeForm>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIGroupMembershipForm
-  -->
-  <UIGroupEditMembershipForm>
-    <label>
-      <username>User Name</username>
-      <membership>Membership</membership>
-    </label>
-    <action>
-      <Save>Save</Save>
-      <Cancel>Cancel</Cancel>
-    </action>
-    <msg>
-      <membership-delete>Can't save, membership removed!.</membership-delete>
-      <membership-exist>"Membership type is existing, please enter another one!.</membership-exist>
-    </msg>
-  </UIGroupEditMembershipForm>
-  <EditMembership>
-    <title>
-      <UIGroupEditMembershipForm>Edit Membership</UIGroupEditMembershipForm>
-      <EditMembership>Edit Membership</EditMembership>
-    </title>
-  </EditMembership>
-  <UIGroupMembershipForm>
-    <label>
-      <title>Group Membership</title>
-      <username>Username</username>
-      <membership>Membership</membership>
-      <SearchUser>Select User</SearchUser>
-      <Refresh>Refresh</Refresh>
-    </label>
-    <action>
-      <Save>#{word.save}</Save>
-    </action>
-    <title>Add member</title>
-  </UIGroupMembershipForm>
-  <SearchUserForm>
-    <label>
-      <option>
-        <userName>#{word.userName}</userName>
-        <firstName>#{word.firstName}</firstName>
-        <lastName>#{word.lastName}</lastName>
-        <email>#{word.email}</email>
-      </option>
-    </label>
-  </SearchUserForm>
-  <SearchUser>
-    <title>
-      <UIUserSelector>Select User</UIUserSelector>
-      <SearchUser>Select User</SearchUser>
-      <ListUserForSearch>Search User</ListUserForSearch>
-    </title>
-  </SearchUser>
-  <!--
-  #{0} is the member that the remote memeber enter
-  -->
-  <UIMemberShipForm>
-    <msg>
-      <membershipType-exist>The membership type '{0}' is taken</membershipType-exist>
-    </msg>
-  </UIMemberShipForm>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIMembershipForm
-  -->
-  <UIMembershipForm>
-    <label>
-      <username>User Name</username>
-      <membership>Membership</membership>
-      <name>Membership Name</name>
-      <description>#{word.description}</description>
-    </label>
-    <action>
-      <Save>#{word.save}</Save>
-      <Back>#{word.back}</Back>
-    </action>
-  </UIMembershipForm>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIListUser
-  -->
-  <UIListUsers>
-    <header>
-      <userName>#{word.userName}</userName>
-      <lastName>#{word.lastName}</lastName>
-      <firstName>#{word.firstName}</firstName>
-      <email>#{word.email}</email>
-      <action>#{word.action}</action>
-    </header>
-    <action>
-      <title>
-        <DeleteUser>Delete User</DeleteUser>
-        <SelectUser>Select User</SelectUser>
-        <ViewUserInfo>Edit User Info</ViewUserInfo>
-      </title>
-    </action>
-    <label>
-      <option>
-        <userName>#{word.userName}</userName>
-        <firstName>#{word.firstName}</firstName>
-        <lastName>#{word.lastName}</lastName>
-        <email>#{word.email}</email>
-      </option>
-    </label>
-    <msg>
-      <DeleteSuperUser>{0} is Super User, it can not be deleted</DeleteSuperUser>
-    </msg>
-    <deleteUser>Are you sure you want to delete {0} user?</deleteUser>
-  </UIListUsers>
-  <UIListMembershipType>
-    <deleteMemberShip>Are you sure you want to delete this membership?</deleteMemberShip>
-  </UIListMembershipType>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIUserInfo
-  -->
-  <UIUserInfo>
-    <title>User Profile Info</title>
-    <tab>
-      <label>
-        <AccountInputSet>Account Info</AccountInputSet>
-        <UIUserProfileInputSet>User Profile</UIUserProfileInputSet>
-        <UIUserMembershipSelector>User Membership</UIUserMembershipSelector>
-        <UIAccountEditInputSet>Account Info</UIAccountEditInputSet>
-      </label>
-    </tab>
-    <label>
-      <changePassword>Change Password:</changePassword>
-      <newPassword>New Password:</newPassword>
-      <confirmPassword>Confirm Password:</confirmPassword>
-      <Profile>User Profile</Profile>
-      <userName>#{word.userName}:</userName>
-      <password>Password :</password>
-      <Confirmpassword>Confirm Password :</Confirmpassword>
-      <firstName>#{word.firstName}:</firstName>
-      <lastName>#{word.lastName}:</lastName>
-      <email>Email Address:</email>
-      <HomeInfo>Home Informations</HomeInfo>
-      <user>
-        <name>
-          <given>#{word.givenName}:</given>
-          <family>#{word.familyName}:</family>
-          <nickName>#{word.nickName}:</nickName>
-        </name>
-        <language>#{word.language}:</language>
-        <bdate>#{word.birthday}:</bdate>
-        <gender>#{word.gender}:</gender>
-        <employer>#{word.employer}:</employer>
-        <department>#{word.department}:</department>
-        <jobtitle>#{word.jobTitle}:</jobtitle>
-        <home-info>
-          <postal>
-            <name>#:</name>
-            <street>#{word.street}:</street>
-            <city>#{word.city}:</city>
-            <stateprov>#{word.stateProv}:</stateprov>
-            <postalcode>#{word.postalCode}:</postalcode>
-            <country>#{word.country}:</country>
-          </postal>
-          <telecom>
-            <mobile>
-              <number>#{word.mobile}:</number>
-            </mobile>
-            <telephone>
-              <number>#{word.tel}:</number>
-            </telephone>
-          </telecom>
-          <online>
-            <email>#{word.email}:</email>
-            <uri>Website:</uri>
-          </online>
-        </home-info>
-        <business-info>
-          <postal>
-            <name>#:</name>
-            <city>#{word.city}:</city>
-            <stateprov>State/Prov:</stateprov>
-            <postalcode>Postal Code:</postalcode>
-            <country>#{word.country}:</country>
-          </postal>
-          <telecom>
-            <mobile>
-              <number>#{word.mobile}:</number>
-            </mobile>
-            <telephone>
-              <number>#{word.tel}:</number>
-            </telephone>
-          </telecom>
-          <online>
-            <email>#{word.email}:</email>
-            <uri>#{word.website}:</uri>
-          </online>
-        </business-info>
-      </user>
-      <option>
-      	<male>Male</male>
-      	<female>Female</female>      	
-      	<en>English</en>
-		<ma>Ma</ma>
-		<vi>Vietnamese</vi>
-		<ar>Arabic</ar>
-		<fr>French</fr>
-		<ru>Russian</ru>
-      </option>
-      <BusinessInfo>Business Informations</BusinessInfo>
-    </label>
-    <action>
-      <Back>#{word.cancel}</Back>
-      <Save>#{word.save}</Save>
-    </action>
-  </UIUserInfo>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIUserInGroup
-  -->
-  <UIUserInGroup>
-    <confirm>
-      <deleteUser>Are you sure you want to delete user {0} from group {1}?</deleteUser>
-    </confirm>
-    <header>
-      <userName>#{word.userName}</userName>
-      <lastName>#{word.lastName}</lastName>
-      <firstName>#{word.firstName}</firstName>
-      <email>#{word.email}</email>
-      <action>#{word.action}</action>
-      <membershipType>Membership Type</membershipType>
-      <lastLoginTime>Last Login</lastLoginTime>
-    </header>
-    <label>
-      <username>#{word.userName}</username>
-      <membership>Membership name</membership>
-    </label>
-    <action>
-      <title>
-        <DeleteUser>Delete member</DeleteUser>
-        <Edit>Edit member</Edit>
-      </title>
-    </action>
-  </UIUserInGroup>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIGroupInfo 
-  -->
-  <UIGroupInfo>
-    <tab>
-      <label>
-        <UIUserInGroup>User In Group</UIUserInGroup>
-      </label>
-    </tab>
-    <label>
-      <UIUserInGroup />
-    </label>
-    <title>Group Info</title>
-  </UIGroupInfo>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIMembershipList
-  -->
-  <UIMembershipList>
-    <header>
-      <name>Membership name</name>
-      <createdDate>Created date</createdDate>
-      <modifiedDate>Modified date</modifiedDate>
-      <action>#{word.action}</action>
-      <description>#{word.description}</description>
-    </header>
-    <action>
-      <title>
-        <EditMembership>Edit Membership</EditMembership>
-        <DeleteMembership>Delete Membership</DeleteMembership>
-      </title>
-    </action>
-    <msg>
-      <InUse>You can not delete this membership because it is in use</InUse>
-      <DeleteMandatory>You can not delete this membership because it is mandatory</DeleteMandatory>
-    </msg>
-  </UIMembershipList>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIGroupMembershipForm
-  -->
-  <UIUserMembershipSelector>
-    <deleteMembership>Are you sure you want to delete this membership?</deleteMembership>
-  </UIUserMembershipSelector>
-  <!--
-  ##org.exoplatform.organization.webui.component.UIGroupForm
-  -->
-  <AddGroup>
-    <title>Add New Group</title>
-    <action>
-      <Save>#{word.save}</Save>
-      <Back>#{word.cancel}</Back>
-    </action>
-  </AddGroup>
-  <EditGroup>
-    <title>Edit Current Group</title>
-    <action>
-      <Save>#{word.save}</Save>
-      <Back>#{word.cancel}</Back>
-    </action>
-  </EditGroup>
-  <UIGroupForm>
-    <label>
-      <groupName>Group Name</groupName>
-      <description>Description</description>
-      <label>Label</label>
-    </label>
-    <msg>
-      <group-exist>This group name is existing, please enter another one!</group-exist>
-    </msg>
-  </UIGroupForm>
-  <!--
-  ############################################################################
-  #   org.exoplatform.portal.component.customization.UIShareNavigationForm   #
-  ############################################################################
-  -->
-  <UITabPane>
-    <title>
-      <UISharedNavigationForm>Shared Navigation</UISharedNavigationForm>
-      <UISharedPortalForm>Shared Portal</UISharedPortalForm>
-      <UIUserInGroup>Group Info</UIUserInGroup>
-      <UISharedNavigation>Group Page Navigation</UISharedNavigation>
-    </title>
-  </UITabPane>
-  <UISharedNavigationForm>
-    <action>
-      <Save>#{word.save}</Save>
-      <Back>#{word.back}</Back>
-      <Remove>Remove</Remove>
-    </action>
-    <label>
-      <navigation>Navigation</navigation>
-      <description>Description</description>
-      <membership>Membership</membership>
-      <priority>Priority</priority>
-    </label>
-    <tab>
-      <label>
-        <SharedNavigation>Shared Navigation Setting</SharedNavigation>
-        <Permission>Permission Selector</Permission>
-      </label>
-    </tab>
-    <msg>
-      <user-nonexist>User "{0}" is not exist</user-nonexist>
-    </msg>
-  </UISharedNavigationForm>
-  <UISharedNavigation>
-    <msg>
-      <notSelected>You must select a group!</notSelected>
-    </msg>
-    <label>
-      <userNavigation>User Page Navigation Name</userNavigation>
-      <priority>Priority</priority>
-    </label>
-    <action>
-      <Save>Save</Save>
-    </action>
-  </UISharedNavigation>
-  <!--
-  #############################################################################
-  #              org.exoplatform.portal.component.customization.UISharePortalForm#
-  #############################################################################
-  -->
-  <UISharedPortalForm>
-    <action>
-      <Save>#{word.save}</Save>
-      <Back>#{word.back}</Back>
-      <Remove>Remove</Remove>
-    </action>
-    <label>
-      <portal>Portal</portal>
-      <description>Description</description>
-      <membership>Membership</membership>
-      <priority>Priority</priority>
-    </label>
-    <tab>
-      <label>
-        <SharedPortal>Portal Setting</SharedPortal>
-        <Permission>Permission Selector</Permission>
-      </label>
-    </tab>
-    <msg>
-      <user-nonexist>User "{0}" is not exist</user-nonexist>
-    </msg>
-  </UISharedPortalForm>
-  <UIGroupSharedInfo>
-    <title>Share Info</title>
-  </UIGroupSharedInfo>
-  <!--
-  #############################################################################
-  #           org.exoplatform.portal.organization.component.UIGroupManagement#
-  #############################################################################
-  -->
-  <UIGroupManagement>
-    <label>
-      <Groups>Groups</Groups>
-      <AddGroup>Add New Group</AddGroup>
-      <EditGroup>Edit Selected Group</EditGroup>
-      <DeleteGroup>Delete Selected Group</DeleteGroup>
-    </label>
-    <deleteGroup>Are you sure you want to delete this group?</deleteGroup>
-  </UIGroupManagement>
-  <!--
-  #############################################################################
-  #           org.exoplatform.portal.organization.component.UISharedNavigation#
-  #############################################################################
-  -->
-</bundle>
-

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java	2009-11-12 10:28:30 UTC (rev 577)
@@ -56,17 +56,20 @@
    {
       if (type == ApplicationType.PORTLET)
       {
-         @SuppressWarnings("unchecked") ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)PORTLET;
+         @SuppressWarnings("unchecked")
+         ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)PORTLET;
          return adapter;
       }
       else if (type == ApplicationType.GADGET)
       {
-         @SuppressWarnings("unchecked") ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)GADGET;
+         @SuppressWarnings("unchecked")
+         ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)GADGET;
          return adapter;
       }
       else if (type == ApplicationType.WSRP_PORTLET)
       {
-         @SuppressWarnings("unchecked") ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)WSRP;
+         @SuppressWarnings("unchecked")
+         ModelAdapter<S, C> adapter = (ModelAdapter<S, C>)WSRP;
          return adapter;
       }
       else
@@ -80,7 +83,8 @@
    {
 
       @Override
-      public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId, ApplicationState<Portlet> applicationState) throws Exception
+      public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId,
+         ApplicationState<Portlet> applicationState) throws Exception
       {
          DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
          Portlet preferences = dataStorage.load(applicationState);
@@ -97,7 +101,8 @@
       }
 
       @Override
-      public ApplicationState<Portlet> update(ExoContainer container, ExoPortletState updateState, ApplicationState<Portlet> applicationState) throws Exception
+      public ApplicationState<Portlet> update(ExoContainer container, ExoPortletState updateState,
+         ApplicationState<Portlet> applicationState) throws Exception
       {
          // Compute new preferences
          PortletBuilder builder = new PortletBuilder();
@@ -114,9 +119,8 @@
          }
          else
          {
-            PersistentApplicationState<Portlet> persistentState = (PersistentApplicationState<Portlet>)applicationState;
             DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
-            return dataStorage.save(persistentState, builder.build());
+            return dataStorage.save(applicationState, builder.build());
          }
       }
 
@@ -126,7 +130,8 @@
          String[] chunks = Utils.split("/", applicationState);
          String appName = chunks[0];
          String portletName = chunks[1];
-         return PortletContext.createPortletContext(PortletInvoker.LOCAL_PORTLET_INVOKER_ID + "./" + appName + "." + portletName);
+         return PortletContext.createPortletContext(PortletInvoker.LOCAL_PORTLET_INVOKER_ID + "./" + appName + "."
+            + portletName);
       }
 
       @Override
@@ -136,14 +141,17 @@
          {
             TransientApplicationState<Portlet> transientState = (TransientApplicationState<Portlet>)applicationState;
             Portlet pref = transientState.getContentState();
-            if(pref == null) pref = new Portlet();
+            if (pref == null)
+               pref = new Portlet();
             return pref;
          }
          else
          {
-            PersistentApplicationState<Portlet> persistentState = (PersistentApplicationState<Portlet>)applicationState;
             DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
-            return dataStorage.load(persistentState);
+            Portlet pref = dataStorage.load(applicationState);
+            if (pref == null)
+               pref = new Portlet();
+            return pref;
          }
       }
    };
@@ -158,9 +166,11 @@
       private final PortletContext WRAPPER_CONTEXT = PortletContext.createPortletContext(WRAPPER_ID);
 
       @Override
-      public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId, ApplicationState<Gadget> applicationState) throws Exception
+      public StatefulPortletContext<ExoPortletState> getPortletContext(ExoContainer container, String applicationId,
+         ApplicationState<Gadget> applicationState) throws Exception
       {
-         GadgetRegistryService gadgetService = (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+         GadgetRegistryService gadgetService =
+            (GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
          org.exoplatform.application.gadget.Gadget model = gadgetService.getGadget(applicationId);
          GadgetApplication application = new GadgetApplication(model.getName(), model.getUrl(), model.isLocal());
          String url = GadgetUtil.reproduceUrl(application.getUrl(), application.isLocal());
@@ -170,7 +180,8 @@
       }
 
       @Override
-      public ApplicationState<Gadget> update(ExoContainer container, ExoPortletState updateState, ApplicationState<Gadget> gadgetApplicationState) throws Exception
+      public ApplicationState<Gadget> update(ExoContainer container, ExoPortletState updateState,
+         ApplicationState<Gadget> gadgetApplicationState) throws Exception
       {
          throw new UnsupportedOperationException("todo / julien");
       }
@@ -189,13 +200,12 @@
       }
    };
 
-
    private static final ModelAdapter<WSRP, WSRP> WSRP = new ModelAdapter<WSRP, WSRP>()
    {
       @Override
       public Portlet getState(ExoContainer container, ApplicationState<WSRP> state) throws Exception
       {
-         return null;  // return null for now
+         return null; // return null for now
       }
 
       @Override
@@ -205,7 +215,8 @@
       }
 
       @Override
-      public StatefulPortletContext<WSRP> getPortletContext(ExoContainer container, String applicationId, ApplicationState<WSRP> state) throws Exception
+      public StatefulPortletContext<WSRP> getPortletContext(ExoContainer container, String applicationId,
+         ApplicationState<WSRP> state) throws Exception
       {
          DataStorage dataStorage = (DataStorage)container.getComponentInstanceOfType(DataStorage.class);
          WSRP wsrp = dataStorage.load(state);
@@ -218,7 +229,8 @@
       }
 
       @Override
-      public ApplicationState<WSRP> update(ExoContainer container, WSRP updateState, ApplicationState<WSRP> state) throws Exception
+      public ApplicationState<WSRP> update(ExoContainer container, WSRP updateState, ApplicationState<WSRP> state)
+         throws Exception
       {
          if (state instanceof TransientApplicationState)
          {
@@ -237,9 +249,11 @@
 
    public abstract PortletContext getProducerOfferedPortletContext(String applicationId);
 
-   public abstract StatefulPortletContext<C> getPortletContext(ExoContainer container, String applicationId, ApplicationState<S> applicationState) throws Exception;
+   public abstract StatefulPortletContext<C> getPortletContext(ExoContainer container, String applicationId,
+      ApplicationState<S> applicationState) throws Exception;
 
-   public abstract ApplicationState<S> update(ExoContainer container, C updateState, ApplicationState<S> applicationState) throws Exception;
+   public abstract ApplicationState<S> update(ExoContainer container, C updateState,
+      ApplicationState<S> applicationState) throws Exception;
 
    /**
     * Returns the state of the gadget as preferences or null if the preferences cannot be edited as such.

Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java	2009-11-12 09:48:36 UTC (rev 576)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java	2009-11-12 10:28:30 UTC (rev 577)
@@ -19,14 +19,18 @@
 
 package org.exoplatform.portal.webui.portal;
 
+import org.exoplatform.application.registry.Application;
 import org.exoplatform.commons.utils.PageList;
 import org.exoplatform.portal.application.PortalRequestContext;
 import org.exoplatform.portal.config.UserACL;
 import org.exoplatform.portal.config.model.ApplicationType;
 import org.exoplatform.portal.config.model.CloneApplicationState;
 import org.exoplatform.portal.config.model.Container;
+import org.exoplatform.portal.config.model.TransientApplicationState;
+import org.exoplatform.portal.pom.spi.gadget.Gadget;
 import org.exoplatform.portal.webui.application.PortletState;
 import org.exoplatform.portal.webui.application.UIApplicationList;
+import org.exoplatform.portal.webui.application.UIGadget;
 import org.exoplatform.portal.webui.application.UIPortlet;
 import org.exoplatform.portal.webui.container.UIContainerList;
 import org.exoplatform.portal.webui.login.UILogin;
@@ -235,10 +239,17 @@
             }
             else
             {
-               org.exoplatform.application.registry.Application app = null;
+               Application app = null;
                UIApplicationList appList = uiApp.findFirstComponentOfType(UIApplicationList.class);
                app = appList.getApplication(sourceId);
                ApplicationType applicationType = app.getType();
+               Application temp = null;
+               if (applicationType.equals(ApplicationType.GADGET))
+               {
+                  applicationType = ApplicationType.PORTLET;
+                  temp = app;
+                  app = appList.getApplication("dashboard/Gadget_Wrapper_Portlet");
+               }
 
                //
                UIPortlet uiPortlet = uiTarget.createUIComponent(UIPortlet.class, null, null);
@@ -268,6 +279,12 @@
 
                //
                uiPortlet.setState(new PortletState(state, applicationType));
+               if (temp != null && applicationType.equals(ApplicationType.PORTLET))
+               {
+                  UIGadget uiGadget = uiPortlet.createUIComponent(UIGadget.class, null, null);
+                  uiGadget.setState(new TransientApplicationState<Gadget>(temp.getApplicationName()));
+                  uiPortlet.getPreferences().setValue("url", uiGadget.getUrl());
+               }
 
                uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
                uiPortlet.setShowEditControl(true);
@@ -303,7 +320,6 @@
          uiTarget.getChildren().add(position, uiSource);
          uiSource.setParent(uiTarget);
       }
-
    }
 
    public static class ChangeLanguageActionListener extends EventListener<UIPortal>



More information about the gatein-commits mailing list