From do-not-reply at jboss.org Tue Jun 8 23:14:13 2010
Content-Type: multipart/mixed; boundary="===============2388154230564085205=="
MIME-Version: 1.0
From: do-not-reply at jboss.org
To: gatein-commits at lists.jboss.org
Subject: [gatein-commits] gatein SVN: r3260 - in portal/trunk:
component/portal/src/main/java/org/exoplatform/portal/config/model and 7
other directories.
Date: Tue, 08 Jun 2010 23:14:12 -0400
Message-ID: <201006090314.o593ECGI014287@svn01.web.mwc.hst.phx2.redhat.com>
--===============2388154230564085205==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: trong.tran
Date: 2010-06-08 23:14:12 -0400 (Tue, 08 Jun 2010)
New Revision: 3260
Added:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/Const=
ants.java
Removed:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/confi=
g/model/util/
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/=
mock/
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization=
/webui/component/UIUserInfo.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormC=
heckBoxInput.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/=
UIUserProfileInputSet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/app=
lication/UIPortletActionListener.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/app=
lication/UIPortletLifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/por=
tal/UILanguageSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/por=
tal/UIPortalComposer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/por=
tal/UISkinSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/wor=
kspace/UIPortalApplication.java
Log:
Clean up and improve a little code
Added: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/C=
onstants.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/Cons=
tants.java (rev 0)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/Cons=
tants.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -0,0 +1,35 @@
+/**
+ * Copyright (C) 2010 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;
+
+/**
+ * @author Trong Tran
+ * @version $Revision$
+ */
+
+public class Constants
+{
+ public static final String USER_LANGUAGE =3D "user.language";
+ =
+ public static final String USER_SKIN =3D "user.skin";
+
+ public static final String PORTAL_WINDOW_STATE =3D "portal:windowState";
+
+ public static final String PORTAL_PORTLET_MODE =3D "portal:portletMode";
+}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organ=
ization/webui/component/UIUserInfo.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organizatio=
n/webui/component/UIUserInfo.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organizatio=
n/webui/component/UIUserInfo.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -20,6 +20,7 @@
package org.exoplatform.organization.webui.component;
=
import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.portal.Constants;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
@@ -123,7 +124,7 @@
{
UserProfileHandler hanlder =3D service.getUserProfileHandler();
UserProfile userProfile =3D hanlder.findUserProfileByName(even=
t.getRequestContext().getRemoteUser());
- String language =3D userProfile.getAttribute("user.language");
+ String language =3D userProfile.getAttribute(Constants.USER_LA=
NGUAGE);
=
UIPortalApplication uiApp =3D Util.getUIPortalApplication(); =
=
if (language =3D=3D null || language.trim().length() < 1)
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/=
UIFormCheckBoxInput.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm=
CheckBoxInput.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIForm=
CheckBoxInput.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -137,8 +137,6 @@
if (onchange_ !=3D null)
{
UIForm uiForm =3D getAncestorOfType(UIForm.class);
- //TODO TrongTT: The onchange don't affect in IE. =
- // w.append(" onchange=3D\"").append(renderOnChangeEvent(uiF=
orm)).append("\"");
w.append(" onclick=3D\"").append(renderOnChangeEvent(uiForm)).app=
end("\"");
}
if (checked)
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organi=
zation/UIUserProfileInputSet.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization=
/UIUserProfileInputSet.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization=
/UIUserProfileInputSet.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -20,6 +20,7 @@
package org.exoplatform.webui.organization;
=
import org.exoplatform.commons.serialization.api.annotations.Serialized;
+import org.exoplatform.portal.Constants;
import org.exoplatform.services.organization.OrganizationService;
import org.exoplatform.services.organization.UserProfile;
import org.exoplatform.services.organization.UserProfileHandler;
@@ -106,7 +107,7 @@
set.addUIFormInput(genderSelectBox);
continue;
}
- else if (key.equalsIgnoreCase("user.language"))
+ else if (key.equalsIgnoreCase(Constants.USER_LANGUAGE))
{
UIFormSelectBox langSelectBox =3D new UIFormSelectBox(key, key=
, null);
set.addUIFormInput(langSelectBox);
@@ -123,7 +124,7 @@
@Override
public void processRender(WebuiRequestContext context) throws Exception
{
- UIFormSelectBox langSelectBox =3D this.findComponentById("user.langu=
age");
+ UIFormSelectBox langSelectBox =3D this.findComponentById(Constants.U=
SER_LANGUAGE);
initLanguageCombo(langSelectBox);
super.processRender(context);
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/we=
bui/application/UIPortletActionListener.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/ap=
plication/UIPortletActionListener.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/ap=
plication/UIPortletActionListener.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -19,6 +19,7 @@
=
package org.exoplatform.portal.webui.application;
=
+import org.exoplatform.portal.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.exoplatform.portal.webui.page.UIPage;
@@ -709,8 +710,7 @@
pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
pcontext.setFullRender(true);
=
- String windowState =3D event.getRequestContext().getRequestParame=
ter("portal:windowState");
- //TODO TrongTT: We should use only parameter for change WindowSta=
te
+ String windowState =3D event.getRequestContext().getRequestParame=
ter(Constants.PORTAL_WINDOW_STATE);
if (windowState =3D=3D null)
{
windowState =3D event.getRequestContext().getRequestParameter(=
UIComponent.OBJECTID).trim();
@@ -773,8 +773,7 @@
public void execute(Event event) throws Exception
{
UIPortlet uiPortlet =3D event.getSource();
- String portletMode =3D event.getRequestContext().getRequestParame=
ter("portal:portletMode");
- //TODO TrongTT: We should use only parameter for change PortletMo=
de
+ String portletMode =3D event.getRequestContext().getRequestParame=
ter(Constants.PORTAL_PORTLET_MODE);
if (portletMode =3D=3D null)
{
portletMode =3D event.getRequestContext().getRequestParameter(=
UIComponent.OBJECTID);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/we=
bui/application/UIPortletLifecycle.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/ap=
plication/UIPortletLifecycle.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/ap=
plication/UIPortletLifecycle.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -92,7 +92,7 @@
return;
}
=
- String portletMode =3D context.getRequestParameter("portal:portle=
tMode");
+ String portletMode =3D context.getRequestParameter(org.exoplatfor=
m.portal.Constants.PORTAL_PORTLET_MODE);
if (portletMode !=3D null)
{
Event event =3D uicomponent.createEvent("ChangePo=
rtletMode", Event.Phase.PROCESS, context);
@@ -100,7 +100,7 @@
event.broadcast();
}
=
- String windowState =3D context.getRequestParameter("portal:window=
State");
+ String windowState =3D context.getRequestParameter(org.exoplatfor=
m.portal.Constants.PORTAL_WINDOW_STATE);
if (windowState !=3D null)
{
Event event =3D uicomponent.createEvent("ChangeWi=
ndowState", Event.Phase.PROCESS, context);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/we=
bui/portal/UILanguageSelector.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/po=
rtal/UILanguageSelector.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/po=
rtal/UILanguageSelector.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -19,6 +19,7 @@
=
package org.exoplatform.portal.webui.portal;
=
+import org.exoplatform.portal.Constants;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
import org.exoplatform.portal.webui.workspace.UIPortalApplication;
@@ -137,7 +138,7 @@
if (remoteUser !=3D null)
{
UserProfile userProfile =3D orgService.getUserProfileHandler()=
.findUserProfileByName(remoteUser);
- userProfile.getUserInfoMap().put("user.language", language);
+ userProfile.getUserInfoMap().put(Constants.USER_LANGUAGE, lang=
uage);
UserProfileHandler hanlder =3D orgService.getUserProfileHandle=
r();
hanlder.saveUserProfile(userProfile, true);
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/we=
bui/portal/UIPortalComposer.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/po=
rtal/UIPortalComposer.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/po=
rtal/UIPortalComposer.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -19,6 +19,7 @@
=
package org.exoplatform.portal.webui.portal;
=
+import org.exoplatform.portal.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.StaleModelException;
@@ -222,7 +223,7 @@
String portalAppLanguage =3D uiPortalApp.getLocale().getLanguage();
OrganizationService orgService =3D getApplicationComponent(Organizat=
ionService.class);
UserProfile userProfile =3D orgService.getUserProfileHandler().findU=
serProfileByName(remoteUser);
- String userLanguage =3D userProfile.getUserInfoMap().get("user.langu=
age");
+ String userLanguage =3D userProfile.getUserInfoMap().get(Constants.U=
SER_LANGUAGE);
String browserLanguage =3D prContext.getRequest().getLocale().getLan=
guage();
=
// in case: edit current portal, set skin and language for uiPortalA=
pp
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/we=
bui/portal/UISkinSelector.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/po=
rtal/UISkinSelector.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/po=
rtal/UISkinSelector.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -19,6 +19,7 @@
=
package org.exoplatform.portal.webui.portal;
=
+import org.exoplatform.portal.Constants;
import org.exoplatform.portal.resource.SkinService;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.workspace.UIMaskWorkspace;
@@ -117,7 +118,7 @@
if (remoteUser !=3D null)
{
UserProfile userProfile =3D orgService.getUserProfileHandler()=
.findUserProfileByName(remoteUser);
- userProfile.getUserInfoMap().put("user.skin", skin);
+ userProfile.getUserInfoMap().put(Constants.USER_SKIN, skin);
UserProfileHandler hanlder =3D orgService.getUserProfileHandle=
r();
hanlder.saveUserProfile(userProfile, true);
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/we=
bui/workspace/UIPortalApplication.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/wo=
rkspace/UIPortalApplication.java 2010-06-09 03:02:29 UTC (rev 3259)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/wo=
rkspace/UIPortalApplication.java 2010-06-09 03:14:12 UTC (rev 3260)
@@ -20,6 +20,7 @@
package org.exoplatform.portal.webui.workspace;
=
import org.exoplatform.container.ExoContainer;
+import org.exoplatform.portal.Constants;
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.DataStorage;
import org.exoplatform.portal.config.NoSuchDataException;
@@ -155,8 +156,8 @@
UserProfile userProfile =3D orgService.getUserProfileHandler().fi=
ndUserProfileByName(user);
if (userProfile !=3D null)
{
- portalLanguage =3D userProfile.getUserInfoMap().get("user.lang=
uage");
- portalSkin =3D userProfile.getUserInfoMap().get("user.skin");
+ portalLanguage =3D userProfile.getUserInfoMap().get(Constants.=
USER_LANGUAGE);
+ portalSkin =3D userProfile.getUserInfoMap().get(Constants.USER=
_SKIN);
}
else
{
--===============2388154230564085205==--