gatein SVN: r1231 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component.
by do-not-reply@jboss.org
Author: truong.le
Date: 2010-01-12 04:36:10 -0500 (Tue, 12 Jan 2010)
New Revision: 1231
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
Log:
GTNPORTAL-246: Error occur when changing an existing e-mail
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-12 08:54:10 UTC (rev 1230)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-12 09:36:10 UTC (rev 1231)
@@ -135,6 +135,16 @@
}
user.setPassword(pass1x);
}
+
+ //Check if mail address is already used
+ Query query = new Query();
+ query.setEmail(getUIStringInput("email").getValue());
+ if (service.getUserHandler().findUsers(query).getAll().size() > 0)
+ {
+ Object[] args = {username};
+ uiApp.addMessage(new ApplicationMessage("UIAccountInputSet.msg.email-exist", args));
+ return false;
+ }
service.getUserHandler().saveUser(user, true);
enableChangePassword(false);
return true;
14 years, 11 months
gatein SVN: r1230 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal.
by do-not-reply@jboss.org
Author: truong.le
Date: 2010-01-12 03:54:10 -0500 (Tue, 12 Jan 2010)
New Revision: 1230
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
GTNPORTAL-433: NPE when delete current portal in special case
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-01-12 08:28:00 UTC (rev 1229)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-01-12 08:54:10 UTC (rev 1230)
@@ -55,11 +55,13 @@
import org.exoplatform.webui.core.UITabPane;
import org.exoplatform.webui.core.UIWizard;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
import java.util.List;
+import javax.servlet.http.HttpServletRequest;
+
/** Created by The eXo Platform SAS Author : Pham Thanh Tung thanhtungty(a)gmail.com Jun 10, 2009 */
@ComponentConfigs({
@ComponentConfig(template = "app:/groovy/portal/webui/portal/UIPortalComposer.gtmpl", events = {
@@ -162,20 +164,10 @@
String remoteUser = prContext.getRemoteUser();
String ownerUser = prContext.getPortalOwner();
- String portalOwner = null;
- if (editPortal.getOwnerType().equals(PortalConfig.PORTAL_TYPE))
- {
- portalOwner = editPortal.getOwner();
- }
- else
- {
- portalOwner = Util.getPortalRequestContext().getPortalOwner();
- }
-
PortalConfig portalConfig = (PortalConfig)PortalDataMapper.buildModelObject(editPortal);
UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
- if (configService.getUserPortalConfig(portalOwner, remoteUser) != null)
+ if (isPortalExist(editPortal))
{
configService.update(portalConfig);
}
@@ -226,7 +218,26 @@
SkinService skinService = getApplicationComponent(SkinService.class);
skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
}
+
+ public boolean isPortalExist(UIPortal editPortal) throws Exception
+ {
+ String remoteUser = Util.getPortalRequestContext().getRemoteUser();
+ String portalOwner = null;
+ if (editPortal.getOwnerType().equals(PortalConfig.PORTAL_TYPE))
+ {
+ portalOwner = editPortal.getOwner();
+ }
+ else
+ {
+ portalOwner = Util.getPortalRequestContext().getPortalOwner();
+ }
+
+ UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
+
+ return configService.getUserPortalConfig(portalOwner, remoteUser) != null;
+ }
+
public void updateWorkspaceComponent() throws Exception
{
UIPortalApplication uiApp = Util.getUIPortalApplication();
@@ -406,11 +417,32 @@
{
uri = uiPortal.getSelectedNode() != null ? uiPortal.getSelectedNode().getUri() : null;
}
- PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uri);
- uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
- prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
- JavascriptManager jsManager = prContext.getJavascriptManager();
- jsManager.addJavascript("eXo.portal.portalMode=" + UIPortalApplication.NORMAL_MODE + ";");
+
+ if(uiComposer.isPortalExist(editPortal))
+ {
+ PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uri);
+ uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ JavascriptManager jsManager = prContext.getJavascriptManager();
+ jsManager.addJavascript("eXo.portal.portalMode=" + UIPortalApplication.NORMAL_MODE + ";");
+ }
+ else
+ {
+ if(editPortal.getOwner().equals(prContext.getPortalOwner()))
+ {
+ HttpServletRequest request = prContext.getRequest();
+ request.getSession().invalidate();
+ prContext.setResponseComplete(true);
+ prContext.getResponse().sendRedirect(request.getContextPath());
+ return;
+ }
+ else
+ {
+ UIApplication uiApp = prContext.getUIApplication();
+ uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.notExistAnymore", null));
+ prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
+ }
+ }
}
}
14 years, 11 months
gatein SVN: r1229 - in portal/trunk/portlet/exoadmin/src/main: webapp/WEB-INF/classes/locale/portlet/exoadmin and 1 other directory.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2010-01-12 03:28:00 -0500 (Tue, 12 Jan 2010)
New Revision: 1229
Added:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_vi.xml
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_ko.xml
Log:
GTNPORTAL-473 Simplified register portlet is not internationalized (Chau Ngoc Tuan)
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2010-01-12 05:00:58 UTC (rev 1228)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/UIRegisterInputSet.java 2010-01-12 08:28:00 UTC (rev 1229)
@@ -40,25 +40,25 @@
*/
public class UIRegisterInputSet extends UIFormInputWithActions
{
- protected static final String USER_NAME = "User Name:";
+ protected static String USER_NAME = "username";
- protected static final String PASSWORD = "Password:";
+ protected static String PASSWORD = "password";
- protected static final String CONFIRM_PASSWORD = "Confirm Password:";
+ protected static String CONFIRM_PASSWORD = "confirmPassword";
- protected static final String FIRST_NAME = "First Name:";
+ protected static String FIRST_NAME = "firstName";
- protected static final String LAST_NAME = "Last Name:";
+ protected static String LAST_NAME = "lastName";
- protected static final String EMAIL_ADDRESS = "Email Address:";
+ protected static String EMAIL_ADDRESS = "emailAddress";
public UIRegisterInputSet(String name) throws Exception{
super(name);
addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).addValidator(MandatoryValidator.class)
- .addValidator(StringLengthValidator.class, 3, 30).addValidator(ResourceValidator.class).addValidator(
- ExpressionValidator.class, "^[\\p{L}][\\p{L}._\\-\\d]+$", "ResourceValidator.msg.Invalid-char"));
-
+ .addValidator(StringLengthValidator.class, 3, 30).addValidator(ResourceValidator.class)
+ .addValidator(ExpressionValidator.class, "^[\\p{L}][\\p{L}._\\-\\d]+$", "ResourceValidator.msg.Invalid-char"));
+
addUIFormInput(new UIFormStringInput(PASSWORD, PASSWORD, null).setType(UIFormStringInput.PASSWORD_TYPE)
.addValidator(MandatoryValidator.class).addValidator(PasswordStringLengthValidator.class, 6, 30));
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2010-01-12 05:00:58 UTC (rev 1228)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_en.properties 2010-01-12 08:28:00 UTC (rev 1229)
@@ -20,3 +20,10 @@
UIRegisterForm.registerWithSuccess.message=You have successfully registered a new account!
UIRegisterForm.title=Register New Account
UIRegisterForm.label.action.CheckUsernameAvailability=Search User
+
+UIRegisterForm.label.username=User Name:
+UIRegisterForm.label.password=Password:
+UIRegisterForm.label.confirmPassword=Confirm Password:
+UIRegisterForm.label.firstName= First Name:
+UIRegisterForm.label.lastName= Last Name:
+UIRegisterForm.label.emailAddress= Email Address:
\ No newline at end of file
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_ko.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_ko.xml 2010-01-12 05:00:58 UTC (rev 1228)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_ko.xml 2010-01-12 08:28:00 UTC (rev 1229)
@@ -9,6 +9,12 @@
<action>
<CheckUsernameAvailability>사용자 검색</CheckUsernameAvailability>
</action>
+ <username>사용자 이름</username>
+ <password>비밀 번호</password>
+ <confirmPassword>비밀 번호 확인</confirmPassword>
+ <firstName>이름</firstName>
+ <lastName>성</lastName>
+ <emailAddress>이메일 주소</emailAddress>
</label>
</UIRegisterForm>
</bundle>
\ No newline at end of file
Added: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_vi.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_vi.xml (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/classes/locale/portlet/exoadmin/RegisterPortlet_vi.xml 2010-01-12 08:28:00 UTC (rev 1229)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<bundle>
+ <UIRegisterForm>
+ <registerWithSuccess>
+ <message>Bạn đã đăng ký thành công tài khoản.</message>
+ </registerWithSuccess>
+ <title>Đăng ký tài khoản mới</title>
+ <label>
+ <action>
+ <CheckUsernameAvailability>Kiểm tra tên đăng nhập</CheckUsernameAvailability>
+ </action>
+ <username>Tên đăng nhập</username>
+ <password>Mật khẩu</password>
+ <confirmPassword>Xác nhận mật khẩu</confirmPassword>
+ <firstName>Tên</firstName>
+ <lastName>Họ</lastName>
+ <emailAddress>Địa chỉ email</emailAddress>
+ </label>
+ </UIRegisterForm>
+</bundle>
\ No newline at end of file
14 years, 11 months
gatein SVN: r1228 - portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2010-01-12 00:00:58 -0500 (Tue, 12 Jan 2010)
New Revision: 1228
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
Log:
GTNPORTAL-436: Label of Dashboard Tab still over 50 characters
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2010-01-12 04:51:37 UTC (rev 1227)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UITabbedDashboard.js 2010-01-12 05:00:58 UTC (rev 1228)
@@ -148,6 +148,7 @@
inputElement.style.width = "95px";
inputElement.onkeypress = eXo.webui.UITabbedDashboard.createDashboardPage;
inputElement.onblur = eXo.webui.UITabbedDashboard.cancelTabDashboard;
+ inputElement.setAttribute('maxLength', 50);
inputElement.id = portletFrag.parentNode.id; //Store the id of the portlet here
var spanElement = DOMUtil.findDescendantsByTagName(newTabElement, "span")[0];
14 years, 11 months
gatein SVN: r1227 - portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2010-01-11 23:51:37 -0500 (Mon, 11 Jan 2010)
New Revision: 1227
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
Log:
GTNPORTAL-442: Error JS when dropping in edit layout
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-01-12 01:24:48 UTC (rev 1226)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-01-12 04:51:37 UTC (rev 1227)
@@ -261,6 +261,8 @@
newComponent = true;
}
+ if(!targetElement) return;
+
var params = [
{name: "srcID", value: (srcElement.id.replace(/^UIPortlet-/, "")).replace(/^UIContainer-/,"")},
{name: "targetID", value: targetElement.id.replace(/^.*-/, "")},
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-01-12 01:24:48 UTC (rev 1226)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-01-12 04:51:37 UTC (rev 1227)
@@ -545,6 +545,7 @@
var portalComposer = eXo.core.DOMUtil.findFirstDescendantByClass(uiWorkingWS, "div", "UIPortalComposer");
var saveButton = eXo.core.DOMUtil.findFirstDescendantByClass(portalComposer, "a", "SaveButton");
if(saveButton) eXo.core.DOMUtil.replaceClass(saveButton, "SaveButton", "EdittedSaveButton");
+ ajaxAsyncGetRequest(eXo.env.server.createPortalURL(portalComposer.id, "ChangeEdittedState", true));
}
};
14 years, 11 months
gatein SVN: r1226 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-11 20:24:48 -0500 (Mon, 11 Jan 2010)
New Revision: 1226
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
Log:
- Fixed status message that was reporting success on refresh even when that wasn't the case.
- Started adding support for expected registration info as retrieved from producer.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-12 01:20:51 UTC (rev 1225)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2010-01-12 01:24:48 UTC (rev 1226)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -26,7 +26,6 @@
import org.exoplatform.commons.utils.ListAccess;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.portal.webui.container.UIContainerForm;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -36,12 +35,12 @@
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIGrid;
import org.exoplatform.webui.core.UIPopupWindow;
-import org.exoplatform.webui.core.UITabPane;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
import org.gatein.wsrp.WSRPConsumer;
import org.gatein.wsrp.consumer.RefreshResult;
+import org.gatein.wsrp.consumer.RegistrationInfo;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import java.util.List;
@@ -75,6 +74,8 @@
//
public static String[] SELECT_ACTIONS = {"Edit", "Delete", "Refresh", "Activate", "Deactivate"};
+ private RegistrationInfo expectedRegistrationInfo;
+
public List getConfiguredConsumers() throws Exception
{
ConsumerRegistry consumerRegistry = getConsumerRegistry();
@@ -143,6 +144,11 @@
uiGrid.getUIPageIterator().setPageList(pageList);
}
+ private void setExpectedRegistrationInfo(RegistrationInfo expectedRegistrationInfo)
+ {
+ this.expectedRegistrationInfo = expectedRegistrationInfo;
+ }
+
static public class RefreshGridActionListener extends EventListener<UIWsrpConsumerOverview>
{
public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
@@ -292,12 +298,14 @@
if (result.hasIssues())
{
// create the expected registration info and make it available
- /*RegistrationInfo expected = new RegistrationInfo(consumer.getProducerInfo().getRegistrationInfo());
+ RegistrationInfo expected = new RegistrationInfo(consumer.getProducerInfo().getRegistrationInfo());
expected.refresh(result.getServiceDescription(), consumer.getProducerId(), true, true, true);
- setExpectedRegistrationInfo(expected);*/
+ consumerOverview.setExpectedRegistrationInfo(expected);
// refresh had issues, we should deactivate this consumer
registry.deactivateConsumerWith(consumer.getProducerId());
+
+ uiApp.addMessage(new ApplicationMessage("Consumer refresh resulted in errors that need to be fixed", null, ApplicationMessage.ERROR));
}
else
{
@@ -310,9 +318,8 @@
{
registry.deactivateConsumerWith(consumer.getProducerId());
}
-
+ uiApp.addMessage(new ApplicationMessage("Consumer Refreshed Successfully", null));
}
- uiApp.addMessage(new ApplicationMessage("Consumer Refreshed Successfully", null));
consumerOverview.refreshGrid(event);
}
}
14 years, 11 months
gatein SVN: r1225 - in portal/trunk: webui/core/src/main/java/org/exoplatform/webui/core and 4 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-11 20:20:51 -0500 (Mon, 11 Jan 2010)
New Revision: 1225
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageWizard.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
Log:
- Fixed typo.
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -1,16 +1,16 @@
/**
* 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
@@ -38,12 +38,7 @@
import org.exoplatform.webui.form.validator.StringLengthValidator;
import org.exoplatform.webui.organization.UIUserProfileInputSet;
-/**
- * Created by The eXo Platform SARL
- * Author : dang.tung
- * tungcnw(a)gmail.com
- * Jun 25, 2008
- */
+/** Created by The eXo Platform SARL Author : dang.tung tungcnw(a)gmail.com Jun 25, 2008 */
public class UIAccountEditInputSet extends UIFormInputSet
{
@@ -98,7 +93,9 @@
public void setValue(User user) throws Exception
{
if (user == null)
+ {
return;
+ }
invokeGetBindingField(user);
}
@@ -118,7 +115,7 @@
UIListUsers listUser = userManagement.getChild(UIListUsers.class);
UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
- userInfo.setRenderSibbling(UIListUsers.class);
+ userInfo.setRenderSibling(UIListUsers.class);
listUser.search(new Query());
accountInput.reset();
userProfile.reset();
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -1,16 +1,16 @@
/**
* 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
@@ -30,8 +30,8 @@
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
import org.exoplatform.webui.form.UIFormStringInput;
import org.exoplatform.webui.form.UIFormTextAreaInput;
@@ -39,13 +39,7 @@
import org.exoplatform.webui.form.validator.MandatoryValidator;
import org.exoplatform.webui.form.validator.StringLengthValidator;
-/**
- * Created by The eXo Platform SARL
- * Author : chungnv
- * nguyenchung136(a)yahoo.com
- * Jun 27, 2006
- * 8:48:47 AM
- */
+/** Created by The eXo Platform SARL Author : chungnv nguyenchung136(a)yahoo.com Jun 27, 2006 8:48:47 AM */
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormWithTitle.gtmpl", events = {
@EventConfig(listeners = UIGroupForm.SaveActionListener.class),
@EventConfig(phase = Phase.DECODE, listeners = UIGroupForm.BackActionListener.class)})
@@ -114,9 +108,10 @@
{
currentGroup.setLabel(currentGroup.getGroupName());
}
-
+
Group updateGroup = service.getGroupHandler().findGroupById(currentGroup.getGroupName());
- if (updateGroup == null) {
+ if (updateGroup == null)
+ {
Object[] args = {"GroupName", currentGroup.getGroupName()};
UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("UIGroupForm.msg.group-not-exist", args));
@@ -126,12 +121,12 @@
uiGroupDetail.setRenderedChild(UIGroupInfo.class);
return;
}
-
+
service.getGroupHandler().saveGroup(currentGroup, false);
uiGroupForm.reset();
uiGroupForm.setGroup(null);
uiGroupExplorer.changeGroup(currentGroup.getId());
- uiGroupForm.setRenderSibbling(UIGroupInfo.class);
+ uiGroupForm.setRenderSibling(UIGroupInfo.class);
return;
}
@@ -139,13 +134,17 @@
String currentGroupId = null;
currentGroup = uiGroupExplorer.getCurrentGroup();
if (currentGroup != null)
+ {
currentGroupId = currentGroup.getId();
+ }
String groupName = "/" + uiGroupForm.getUIStringInput(GROUP_NAME).getValue();
GroupHandler groupHandler = service.getGroupHandler();
if (currentGroupId != null)
+ {
groupName = currentGroupId + groupName;
+ }
Group newGroup = groupHandler.findGroupById(groupName);
if (newGroup != null)
@@ -186,7 +185,7 @@
uiGroupExplorer.changeGroup(changeGroupId);
uiGroupForm.reset();
uiGroupForm.setGroup(null);
- uiGroupForm.setRenderSibbling(UIGroupInfo.class);
+ uiGroupForm.setRenderSibling(UIGroupInfo.class);
}
}
@@ -197,7 +196,7 @@
UIGroupForm uiGroupForm = event.getSource();
uiGroupForm.reset();
uiGroupForm.setGroup(null);
- uiGroupForm.setRenderSibbling(UIGroupInfo.class);
+ uiGroupForm.setRenderSibling(UIGroupInfo.class);
event.getRequestContext().setProcessRender(true);
}
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIUserInfo.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -1,16 +1,16 @@
/**
* 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
@@ -28,21 +28,15 @@
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.form.UIFormInputContainer;
import org.exoplatform.webui.form.UIFormInputSet;
import org.exoplatform.webui.form.UIFormTabPane;
import org.exoplatform.webui.organization.UIUserMembershipSelector;
import org.exoplatform.webui.organization.UIUserProfileInputSet;
-/**
- * Created by The eXo Platform SARL
- * Author : chungnv
- * nguyenchung136(a)yahoo.com
- * Jun 23, 2006
- * 10:07:15 AM
- */
+/** Created by The eXo Platform SARL Author : chungnv nguyenchung136(a)yahoo.com Jun 23, 2006 10:07:15 AM */
@ComponentConfig(lifecycle = UIFormLifecycle.class, template = "system:/groovy/webui/form/UIFormTabPane.gtmpl", events = {
@EventConfig(listeners = UIUserInfo.SaveActionListener.class),
@EventConfig(listeners = UIUserInfo.BackActionListener.class, phase = Phase.DECODE),
@@ -92,10 +86,14 @@
super.processRender(context);
UIUserMembershipSelector uiUserMembershipSelector = getChild(UIUserMembershipSelector.class);
if (uiUserMembershipSelector == null)
+ {
return;
+ }
UIPopupWindow uiPopupWindow = uiUserMembershipSelector.getChild(UIPopupWindow.class);
if (uiPopupWindow == null)
+ {
return;
+ }
uiPopupWindow.processRender(context);
}
@@ -107,7 +105,9 @@
OrganizationService service = uiUserInfo.getApplicationComponent(OrganizationService.class);
boolean save = uiUserInfo.getChild(UIAccountEditInputSet.class).save(service);
if (!save)
+ {
return;
+ }
uiUserInfo.getChild(UIUserProfileInputSet.class).save(service, uiUserInfo.getUserName(), false);
}
}
@@ -121,7 +121,7 @@
UIListUsers listUser = userManagement.getChild(UIListUsers.class);
UIAccountEditInputSet accountInput = userInfo.getChild(UIAccountEditInputSet.class);
UIUserProfileInputSet userProfile = userInfo.getChild(UIUserProfileInputSet.class);
- userInfo.setRenderSibbling(UIListUsers.class);
+ userInfo.setRenderSibling(UIListUsers.class);
listUser.search(new Query());
accountInput.reset();
userProfile.reset();
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -1,16 +1,16 @@
/**
* 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
@@ -27,17 +27,14 @@
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.Component;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.MonitorEvent;
-import org.exoplatform.webui.event.Event.Phase;
import java.util.ArrayList;
import java.util.List;
-/**
- * Created by The eXo Platform SAS
- * May 7, 2006
- */
+/** Created by The eXo Platform SAS May 7, 2006 */
abstract public class UIComponent
{
@@ -63,9 +60,13 @@
public UIComponent setId(String id)
{
if (id == null)
+ {
this.id = Integer.toString(hashCode());
+ }
else
+ {
this.id = id;
+ }
return this;
}
@@ -107,6 +108,7 @@
// }
// }
//
+
public void processDecode(WebuiRequestContext context) throws Exception
{
MonitorEvent<UIComponent> mevent = createMonitorEvent(Event.Phase.DECODE, context);
@@ -159,7 +161,9 @@
{
this.config = config;
if (componentId == null || componentId.length() == 0)
+ {
componentId = config.getId();
+ }
if (componentId == null)
{
String type = config.getType();
@@ -191,7 +195,9 @@
while (parent != null)
{
if (classType.isInstance(parent))
+ {
return classType.cast(parent);
+ }
parent = parent.getParent();
}
return null;
@@ -212,21 +218,27 @@
{
org.exoplatform.webui.config.Event event = config.getUIComponentEventConfig(name);
if (event == null)
+ {
return "??config??";
+ }
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
URLBuilder<UIComponent> urlBuilder = context.getURLBuilder();
if (urlBuilder == null)
+ {
return "??builder??";
+ }
String confirm = loadConfirmMesssage(event, context, beanId);
return urlBuilder.createAjaxURL(this, event.getName(), confirm, beanId, params);
}
protected String loadConfirmMesssage(org.exoplatform.webui.config.Event event, WebuiRequestContext context,
- String beanId)
+ String beanId)
{
String confirmKey = event.getConfirm();
if (confirmKey.length() < 1)
+ {
return confirmKey;
+ }
try
{
String confirm = context.getApplicationResourceBundle().getString(confirmKey);
@@ -253,7 +265,9 @@
{
org.exoplatform.webui.config.Event event = config.getUIComponentEventConfig(name);
if (event == null)
+ {
return "??config??";
+ }
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
String confirm = loadConfirmMesssage(event, context, beanId);
try
@@ -298,20 +312,26 @@
public <T> void broadcast(Event<T> event, Phase phase) throws Exception
{
if (config == null)
+ {
return;
+ }
org.exoplatform.webui.config.Event econfig = config.getUIComponentEventConfig(event.getName());
if (econfig == null)
+ {
return;
+ }
Phase executionPhase = econfig.getExecutionPhase();
if (executionPhase == phase || executionPhase == Event.Phase.ANY)
{
for (EventListener<T> listener : econfig.getCachedEventListeners())
+ {
listener.execute(event);
+ }
}
}
public <T extends UIComponent> T createUIComponent(Class<T> type, String configId, String componentId,
- UIComponent parent) throws Exception
+ UIComponent parent) throws Exception
{
T uicomp = createUIComponent(type, configId, componentId);
uicomp.setParent(parent);
@@ -326,7 +346,7 @@
}
public <T extends UIComponent> T createUIComponent(WebuiRequestContext context, Class<T> type, String configId,
- String componentId) throws Exception
+ String componentId) throws Exception
{
WebuiApplication app = (WebuiApplication)context.getApplication();
T comp = app.createUIComponent(type, configId, componentId, context);
@@ -337,24 +357,30 @@
public <T extends UIComponent> T findComponentById(String lookupId)
{
if (getId().equals(lookupId))
+ {
return (T)this;
+ }
return null;
}
public <T extends UIComponent> T findFirstComponentOfType(Class<T> type)
{
if (type.isInstance(this))
+ {
return type.cast(this);
+ }
return null;
}
public <T> void findComponentOfType(List<T> list, Class<T> type)
{
if (type.isInstance(this))
+ {
list.add(type.cast(this));
+ }
}
- public <T extends UIComponent> void setRenderSibbling(Class<T> type)
+ public <T extends UIComponent> void setRenderSibling(Class<T> type)
{
if (uiparent instanceof UIContainer)
{
@@ -363,9 +389,13 @@
for (UIComponent child : children)
{
if (type.isInstance(child))
+ {
child.setRendered(true);
+ }
else
+ {
child.setRendered(false);
+ }
}
}
}
@@ -385,10 +415,14 @@
public Event<UIComponent> createEvent(String name, Phase phase, WebuiRequestContext context) throws Exception
{
if (config == null)
+ {
return null;
+ }
org.exoplatform.webui.config.Event econfig = config.getUIComponentEventConfig(name);
if (econfig == null)
+ {
return null;
+ }
Phase executionPhase = econfig.getExecutionPhase();
if (executionPhase == phase || executionPhase == Event.Phase.ANY)
{
@@ -403,11 +437,15 @@
private MonitorEvent<UIComponent> createMonitorEvent(Phase phase, WebuiRequestContext context) throws Exception
{
if (config == null)
+ {
return null;
+ }
org.exoplatform.webui.config.Event econfig =
config.getUIComponentEventConfig(MonitorEvent.UICOMPONENT_LIFECYCLE_MONITOR_EVENT);
if (econfig == null)
+ {
return null;
+ }
Phase executionPhase = econfig.getExecutionPhase();
if (executionPhase == phase || executionPhase == Event.Phase.ANY)
{
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIGroupMembershipSelector.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -1,16 +1,16 @@
/**
* 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
@@ -29,25 +29,21 @@
import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIBreadcumbs;
+import org.exoplatform.webui.core.UIBreadcumbs.LocalPath;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIPopupWindow;
import org.exoplatform.webui.core.UITree;
-import org.exoplatform.webui.core.UIBreadcumbs.LocalPath;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.form.UIForm;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-/**
- * Author : Nhu Dinh Thuan
- * nhudinhthuan(a)exoplatform.com
- * Jun 27, 2006
- */
+/** Author : Nhu Dinh Thuan nhudinhthuan(a)exoplatform.com Jun 27, 2006 */
@ComponentConfigs({
@ComponentConfig(template = "system:/groovy/organization/webui/component/UIGroupMembershipSelector.gtmpl", events = {
@EventConfig(phase = Phase.DECODE, listeners = UIGroupMembershipSelector.ChangeNodeActionListener.class),
@@ -132,10 +128,14 @@
selectGroup_ = service.getGroupHandler().findGroupById(groupId);
String parentGroupId = null;
if (selectGroup_ != null)
+ {
parentGroupId = selectGroup_.getParentId();
+ }
Group parentGroup = null;
if (parentGroupId != null)
+ {
parentGroup = service.getGroupHandler().findGroupById(parentGroupId);
+ }
Collection childrenGroup = service.getGroupHandler().findGroups(selectGroup_);
sibblingGroup = service.getGroupHandler().findGroups(parentGroup);
@@ -149,13 +149,19 @@
private List<LocalPath> getPath(List<LocalPath> list, String id) throws Exception
{
if (list == null)
+ {
list = new ArrayList<LocalPath>(5);
+ }
if (id == null)
+ {
return list;
+ }
OrganizationService service = getApplicationComponent(OrganizationService.class);
Group group = service.getGroupHandler().findGroupById(id);
if (group == null)
+ {
return list;
+ }
list.add(0, new LocalPath(group.getId(), group.getGroupName()));
getPath(list, group.getParentId());
return list;
@@ -170,7 +176,9 @@
{
UIForm uiForm = getAncestorOfType(UIForm.class);
if (uiForm != null)
+ {
return uiForm.event(name, getId(), beanId);
+ }
return super.event(name, beanId);
}
@@ -182,8 +190,8 @@
UIComponent uiComp = event.getSource();
UIGroupMembershipSelector uiSelector = uiComp.getParent();
uiSelector.changeGroup(groupId);
- UIComponent uiPermission = uiSelector.<UIComponent> getParent().getParent();
- uiPermission.setRenderSibbling(uiPermission.getClass());
+ UIComponent uiPermission = uiSelector.<UIComponent>getParent().getParent();
+ uiPermission.setRenderSibling(uiPermission.getClass());
uiPermission.broadcast(event, Event.Phase.PROCESS);
UIPopupWindow uiPopup = uiSelector.getParent();
uiPopup.setShow(true);
@@ -204,8 +212,8 @@
public void execute(Event<UIGroupMembershipSelector> event) throws Exception
{
UIGroupMembershipSelector uiSelector = event.getSource();
- UIComponent uiPermission = uiSelector.<UIComponent> getParent().getParent();
- uiPermission.setRenderSibbling(uiPermission.getClass());
+ UIComponent uiPermission = uiSelector.<UIComponent>getParent().getParent();
+ uiPermission.setRenderSibling(uiPermission.getClass());
WebuiRequestContext pcontext = event.getRequestContext();
UIPopupWindow uiPopup = uiSelector.getParent();
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNodeSelector.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -1,16 +1,16 @@
/**
* 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
@@ -41,13 +41,7 @@
import java.util.List;
-/**
- * Created by The eXo Platform SARL
- * Author : chungnv
- * nguyenchung136(a)yahoo.com
- * Jun 23, 2006
- * 10:07:15 AM
- */
+/** Created by The eXo Platform SARL Author : chungnv nguyenchung136(a)yahoo.com Jun 23, 2006 10:07:15 AM */
@ComponentConfig(template = "system:/groovy/portal/webui/navigation/UIPageNodeSelector.gtmpl", events = {@EventConfig(listeners = UIPageNodeSelector.ChangeNodeActionListener.class)})
public class UIPageNodeSelector extends UIContainer
{
@@ -79,7 +73,9 @@
selectNavigation(portalSelectedNav);
PageNode portalSelectedNode = Util.getUIPortal().getSelectedNode();
if (portalSelectedNode != null)
+ {
selectPageNodeByUri(portalSelectedNode.getUri());
+ }
return;
}
selectNavigation();
@@ -88,16 +84,22 @@
private void selectNavigation()
{
if (selectedNavigation == null)
+ {
return;
+ }
if (selectedNode == null || selectedNavigation.getId() != selectedNode.getPageNavigation().getId())
{
selectedNode = new SelectedNode(selectedNavigation, null, null);
if (selectedNavigation.getNodes().size() > 0)
+ {
selectedNode.setNode(selectedNavigation.getNodes().get(0));
+ }
}
selectNavigation(selectedNode.getPageNavigation());
if (selectedNode.getNode() != null)
+ {
selectPageNodeByUri(selectedNode.getNode().getUri());
+ }
}
public void selectNavigation(PageNavigation pageNav)
@@ -112,7 +114,9 @@
public void selectPageNodeByUri(String uri)
{
if (selectedNode == null || (selectedNavigation.getId() != selectedNode.getPageNavigation().getId()))
+ {
return;
+ }
UITree tree = getChild(UITree.class);
List<?> sibbling = tree.getSibbling();
tree.setSibbling(null);
@@ -132,16 +136,22 @@
public PageNode searchPageNodeByUri(PageNavigation pageNav, String uri)
{
if (pageNav == null || uri == null)
+ {
return null;
+ }
List<PageNode> pageNodes = pageNav.getNodes();
UITree uiTree = getChild(UITree.class);
for (PageNode ele : pageNodes)
{
PageNode returnPageNode = searchPageNodeByUri(ele, uri, uiTree);
if (returnPageNode == null)
+ {
continue;
+ }
if (uiTree.getSibbling() == null)
+ {
uiTree.setSibbling(pageNodes);
+ }
return returnPageNode;
}
return null;
@@ -150,19 +160,29 @@
private PageNode searchPageNodeByUri(PageNode pageNode, String uri, UITree tree)
{
if (pageNode.getUri().equals(uri))
+ {
return pageNode;
+ }
List<PageNode> children = pageNode.getChildren();
if (children == null)
+ {
return null;
+ }
for (PageNode ele : children)
{
PageNode returnPageNode = searchPageNodeByUri(ele, uri, tree);
if (returnPageNode == null)
+ {
continue;
+ }
if (tree.getSibbling() == null)
+ {
tree.setSibbling(children);
+ }
if (tree.getParentSelected() == null)
+ {
tree.setParentSelected(pageNode);
+ }
selectedNode.setParentNode(pageNode);
return returnPageNode;
}
@@ -230,7 +250,7 @@
PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
UIPortalApplication uiPortalApp = uiPageNodeSelector.getAncestorOfType(UIPortalApplication.class);
UIPortalToolPanel uiToolPanel = Util.getUIPortalToolPanel();
- uiToolPanel.setRenderSibbling(UIPortalToolPanel.class);
+ uiToolPanel.setRenderSibling(UIPortalToolPanel.class);
uiToolPanel.setShowMaskLayer(true);
UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
@@ -269,7 +289,9 @@
UIPage uiPage = Util.toUIPage(node, uiToolPanel);
UIPageBody uiPageBody = uiPortalApp.findFirstComponentOfType(UIPageBody.class);
if (uiPageBody.getUIComponent() != null)
+ {
uiPageBody.setUIComponent(null);
+ }
uiToolPanel.setUIComponent(uiPage);
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageWizard.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageWizard.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageWizard.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -42,7 +42,7 @@
private int numberStep_;
private boolean showWelcome = true;
-
+
private boolean showActions = true;
public UIPageWizard() throws Exception
@@ -99,7 +99,7 @@
PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
UIPortal uiPortal = Util.getUIPortal();
- uiPortal.setRenderSibbling(UIPortal.class);
+ uiPortal.setRenderSibling(UIPortal.class);
pcontext.setFullRender(true);
}
@@ -115,6 +115,7 @@
}
// TODO: Need to place UIPageCreateDescription component in other component
+
public void setDescriptionWizard() throws Exception
{
// UIPortalApplication uiPortalApp =
@@ -134,6 +135,7 @@
}
// TODO: Need to place UIPageCreateDescription component in other component
+
public void setDescriptionWizard(int step) throws Exception
{
// UIPortalApplication uiPortalApp =
@@ -165,7 +167,7 @@
PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
UIPortal uiPortal = Util.getUIPortal();
- uiPortal.setRenderSibbling(UIPortal.class);
+ uiPortal.setRenderSibling(UIPortal.class);
pcontext.setFullRender(true);
UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-01-11 16:53:40 UTC (rev 1224)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2010-01-12 01:20:51 UTC (rev 1225)
@@ -55,8 +55,8 @@
import org.exoplatform.webui.core.UITabPane;
import org.exoplatform.webui.core.UIWizard;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.event.Event.Phase;
import java.util.List;
@@ -311,7 +311,9 @@
portalOwner = uiPortal.getOwner();
}
else
+ {
portalOwner = Util.getPortalRequestContext().getPortalOwner();
+ }
}
else
{
@@ -464,19 +466,19 @@
switch (portalMode)
{
- case UIPortalApplication.APP_BLOCK_EDIT_MODE :
+ case UIPortalApplication.APP_BLOCK_EDIT_MODE:
uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
break;
- case UIPortalApplication.APP_VIEW_EDIT_MODE :
+ case UIPortalApplication.APP_VIEW_EDIT_MODE:
uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
break;
- case UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE :
+ case UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE:
uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
break;
- case UIPortalApplication.CONTAINER_VIEW_EDIT_MODE :
+ case UIPortalApplication.CONTAINER_VIEW_EDIT_MODE:
uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
break;
- default :
+ default:
uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
return;
}
@@ -538,7 +540,7 @@
uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
UIPortal uiPortal = Util.getUIPortal();
- uiPortal.setRenderSibbling(UIPortal.class);
+ uiPortal.setRenderSibling(UIPortal.class);
UIPortalComposer composer = uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(false);
composer.setEditted(false);
14 years, 11 months
gatein SVN: r1224 - in components/wsrp/trunk/consumer/src: test/java/org/gatein/wsrp/consumer and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-01-11 11:53:40 -0500 (Mon, 11 Jan 2010)
New Revision: 1224
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationProperty.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
Log:
- Have EndpointConfigurationInfo.refresh return whether a refresh actually happened.
- Make RegistrationProperty validity be computed based on status instead of relying on a mix of saved
state and status as was previously needed for backward compatibility. As a result, removed setInvalid
method: setStatus should be used instead.
- Check that endpoint refreshed before saving changes so that we don't save stuff unnecessarily.
- Made it possible to set a registration value to null in RegistrationInfo.
- Fixed improper check of null listener in RegistrationProperty.
- Updated test cases.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/EndpointConfigurationInfo.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -154,20 +154,19 @@
return result;
}
- public void refresh() throws InvokerUnavailableException
+ public boolean refresh() throws InvokerUnavailableException
{
- if (isRefreshNeeded())
- {
- forceRefresh();
- }
+ return isRefreshNeeded() && forceRefresh();
}
- void forceRefresh() throws InvokerUnavailableException
+ boolean forceRefresh() throws InvokerUnavailableException
{
getService(WSRPV1ServiceDescriptionPortType.class, serviceFactory);
getService(WSRPV1MarkupPortType.class, serviceFactory);
getService(WSRPV1PortletManagementPortType.class, serviceFactory);
getService(WSRPV1RegistrationPortType.class, serviceFactory);
+
+ return true;
}
public String getRemoteHostAddress()
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/ProducerInfo.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -367,23 +367,27 @@
RefreshResult result = new RefreshResult(); // success by default!
+ boolean didJustRefresh = false;
try
{
- persistentEndpointInfo.refresh();
+ didJustRefresh = persistentEndpointInfo.refresh();
}
catch (InvokerUnavailableException e)
{
log.debug("Couldn't refresh endpoint information, attempting a second time: " + e);
// try again as refresh on a failed service factory will fail without attempting the refresh
- persistentEndpointInfo.forceRefresh();
+ didJustRefresh = persistentEndpointInfo.forceRefresh();
// todo: should we fail fast here?
// throw new PortletInvokerException("Couldn't refresh endpoint information: " + e.getLocalizedMessage());
}
finally
{
- // save changes to endpoint
- registry.updateProducerInfo(this);
+ // save changes to endpoint only if we just refreshed, otherwise unneeded
+ if (didJustRefresh)
+ {
+ registry.updateProducerInfo(this);
+ }
}
// get the service description from the producer
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationInfo.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -305,7 +305,6 @@
public RegistrationProperty setRegistrationPropertyValue(String name, String value)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "registration property name", "RegistrationInfo.setRegistrationPropertyValue");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(value, "registration property value", "RegistrationInfo.setRegistrationPropertyValue");
RegistrationProperty prop = getOrCreateRegistrationPropertiesMap(true).get(name);
if (prop != null)
@@ -574,11 +573,11 @@
{
// mark the prop as invalid
RegistrationProperty prop = properties.get(name);
- prop.setInvalid(Boolean.TRUE, RegistrationProperty.Status.INVALID_VALUE);
+ prop.setStatus(RegistrationProperty.Status.INVALID_VALUE);
// do the same in the result
prop = result.getRegistrationProperties().get(name);
- prop.setInvalid(Boolean.TRUE, RegistrationProperty.Status.INEXISTENT);
+ prop.setStatus(RegistrationProperty.Status.INEXISTENT);
}
else
{
@@ -624,7 +623,7 @@
RegistrationPropertyDescription desc = WSRPUtils.convertToRegistrationPropertyDescription(description);
RegistrationProperty prop = new RegistrationProperty(name, null, WSRPUtils.toString(desc.getLang()), this);
prop.setDescription(desc);
- prop.setInvalid(Boolean.TRUE, RegistrationProperty.Status.MISSING_VALUE);
+ prop.setStatus(RegistrationProperty.Status.MISSING_VALUE);
result.put(name, prop);
}
@@ -664,7 +663,7 @@
for (Object o : persistentRegistrationProperties.values())
{
RegistrationProperty prop = (RegistrationProperty)o;
- prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
+ prop.setStatus(RegistrationProperty.Status.VALID);
}
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationProperty.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationProperty.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/RegistrationProperty.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * 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.
@@ -24,9 +24,10 @@
package org.gatein.wsrp.consumer;
import org.gatein.common.util.ParameterValidation;
-import static org.gatein.wsrp.consumer.RegistrationProperty.Status.*;
import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import static org.gatein.wsrp.consumer.RegistrationProperty.Status.*;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 12019 $
@@ -36,13 +37,12 @@
{
private Long persistentId;
private RegistrationPropertyDescription persistentDescription;
- private Boolean persistentInvalid;
private String persistentLang;
private String persistentName;
private String persistentValue;
+ private Status status;
private transient PropertyChangeListener listener;
- private transient Status status;
public int compareTo(RegistrationProperty o)
{
@@ -79,7 +79,7 @@
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "Name", "RegistrationProperty");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang, "Lang", "RegistrationProperty");
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang, "listener", "RegistrationProperty");
+ ParameterValidation.throwIllegalArgExceptionIfNull(listener, "listener");
this.persistentName = name;
this.persistentLang = lang;
this.listener = listener;
@@ -160,37 +160,21 @@
public Boolean isInvalid()
{
- return persistentInvalid;
- }
-
- void setInvalid(Boolean invalid)
- {
- this.persistentInvalid = invalid;
- }
-
- public boolean isDeterminedInvalid()
- {
- return persistentInvalid != null && persistentInvalid && !UNCHECKED_VALUE.equals(getStatus());
- }
-
- public void setInvalid(Boolean invalid, Status status)
- {
- this.persistentInvalid = invalid;
- if (!invalid)
+ if (UNCHECKED_VALUE.equals(status))
{
- this.status = VALID;
+ return null;
}
else
{
- if (status == null || VALID.equals(status))
- {
- throw new IllegalArgumentException("Invalid status: " + status + " for an invalid property!");
- }
-
- this.status = status;
+ return !VALID.equals(status);
}
}
+ public boolean isDeterminedInvalid()
+ {
+ return !VALID.equals(status) && !UNCHECKED_VALUE.equals(status);
+ }
+
public void setValue(String stringValue)
{
// only change the value if it's not the same as the old one
@@ -198,7 +182,6 @@
{
String oldValue = persistentValue;
persistentValue = stringValue;
- persistentInvalid = null;
if (persistentValue == null)
{
status = MISSING_VALUE;
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/EndpointConfigurationInfoTestCase.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,24 +1,25 @@
/*
-* JBoss, a division of Red Hat
-* Copyright 2006, 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.
-*/
+ * 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.gatein.wsrp.consumer;
@@ -66,7 +67,7 @@
String bea = "http://wsrp.bea.com:7001/producer/producer?WSDL";
info.setWsdlDefinitionURL(bea);
- info.refresh();
+ assertTrue(info.refresh());
assertFalse(info.isRefreshNeeded());
assertTrue(info.isAvailable());
}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationInfoTestCase.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2007, 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. *
- ******************************************************************************/
+/*
+ * 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.gatein.wsrp.consumer;
@@ -126,7 +126,7 @@
// specifiy that the prop is valid to simulate a successful registration (integration test, should have something
// testing that in ProducerInfoTestCase)
- prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
+ prop.setStatus(RegistrationProperty.Status.VALID);
info.setRegistrationPropertyValue("prop0", "value1");
assertTrue(info.isRefreshNeeded());
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java 2010-01-11 10:50:19 UTC (rev 1223)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/RegistrationPropertyTestCase.java 2010-01-11 16:53:40 UTC (rev 1224)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2007, 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. *
- ******************************************************************************/
+/*
+ * 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.gatein.wsrp.consumer;
@@ -54,6 +54,56 @@
prop = new RegistrationProperty("name", VALUE, "en", listener);
}
+ public void testConstructor()
+ {
+ try
+ {
+ new RegistrationProperty(null, VALUE, "en", listener);
+ fail("Should have failed on null name");
+ }
+ catch (Exception e)
+ {
+ }
+
+ try
+ {
+ new RegistrationProperty("name", null, "en", listener);
+ }
+ catch (Exception e)
+ {
+ fail("Shouldn't have failed on null value");
+ }
+
+ try
+ {
+ new RegistrationProperty("name", VALUE, null, listener);
+ fail("Should have failed on null lang");
+ }
+ catch (Exception e)
+ {
+ }
+
+ try
+ {
+ new RegistrationProperty("name", VALUE, "en", null);
+ fail("Should have failed on null listener");
+ }
+ catch (Exception e)
+ {
+ }
+ }
+
+ public void testSetNullValue()
+ {
+ forceValid();
+
+ prop.setValue(null);
+ assertNull(prop.getValue());
+ assertTrue(prop.isInvalid());
+ assertTrue(prop.isDeterminedInvalid());
+ assertEquals(RegistrationProperty.Status.MISSING_VALUE, prop.getStatus());
+ }
+
public void testGetters()
{
assertEquals("name", prop.getName());
@@ -67,7 +117,7 @@
public void testSetValue()
{
- prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
+ forceValid();
// we haven't changed the value, so the status shouldn't have changed
prop.setValue(VALUE);
@@ -81,40 +131,10 @@
assertEquals(RegistrationProperty.Status.UNCHECKED_VALUE, prop.getStatus());
}
- public void testSetInvalid()
+ /** Force valid status so that we can check that status properly change based on state. */
+ private void forceValid()
{
- prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.VALID);
- assertEquals(Boolean.FALSE, prop.isInvalid());
- assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
-
- // whatever the status, if we specifiy that the property is valid, its status should be VALID
- prop.setInvalid(Boolean.FALSE, RegistrationProperty.Status.INEXISTENT);
- assertEquals(Boolean.FALSE, prop.isInvalid());
- assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
-
- prop.setInvalid(Boolean.FALSE, null);
- assertEquals(Boolean.FALSE, prop.isInvalid());
- assertEquals(RegistrationProperty.Status.VALID, prop.getStatus());
-
- try
- {
- prop.setInvalid(true, null);
- fail("setInvalid should not accept a prop to be set invalid without a proper status");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
-
- try
- {
- prop.setInvalid(true, RegistrationProperty.Status.VALID);
- fail("setInvalid should not accept a prop to be set invalid with a VALID status");
- }
- catch (IllegalArgumentException e)
- {
- // expected
- }
+ prop.setStatus(RegistrationProperty.Status.VALID);
}
public void testPropertyChangedEvent()
14 years, 11 months
gatein SVN: r1223 - portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIBarDecorator/UIInfoBar.
by do-not-reply@jboss.org
Author: thanh.do
Date: 2010-01-11 05:50:19 -0500 (Mon, 11 Jan 2010)
New Revision: 1223
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIBarDecorator/UIInfoBar/Stylesheet.css
Log:
UI-510:[Portal] IE7: Error UI when edit container layout
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIBarDecorator/UIInfoBar/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIBarDecorator/UIInfoBar/Stylesheet.css 2010-01-11 10:02:24 UTC (rev 1222)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIBarDecorator/UIInfoBar/Stylesheet.css 2010-01-11 10:50:19 UTC (rev 1223)
@@ -80,7 +80,7 @@
.UIInfoBar .BlueRoundedStyle .FixHeight {
height: 26px;
- _width: 230px;
+ *width: 230px;
white-space: nowrap;
}
14 years, 11 months
gatein SVN: r1222 - in portal/trunk/portlet/web/src/main/webapp: groovy/groovy/webui/component and 1 other directory.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-01-11 05:02:24 -0500 (Mon, 11 Jan 2010)
New Revision: 1222
Modified:
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_en.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_es.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_fr.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ko.xml
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ru.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_uk.properties
portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_vi.xml
portal/trunk/portlet/web/src/main/webapp/groovy/groovy/webui/component/UIBannerPortlet.gtmpl
Log:
GTNPORTAL-472: "Register" link on front page isn't translated
Still requires translation in Ukrainian, Vietnamese, Russian
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_en.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_en.properties 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_en.properties 2010-01-11 10:02:24 UTC (rev 1222)
@@ -27,8 +27,8 @@
UIIFrameEditMode.action.Save=Save
UIBannerPortlet.action.changeLanguage=Change Language
+UIBannerPortlet.action.register=Register
-
#############################################################################
#org.exoplatform.portal.webui.component.UIHomePagePortlet #
#############################################################################
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_es.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_es.properties 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_es.properties 2010-01-11 10:02:24 UTC (rev 1222)
@@ -27,7 +27,7 @@
UIIFrameEditMode.action.Save=Guardar
UIBannerPortlet.action.changeLanguage=Cambiar Idioma
-UIBannerPortlet.action.Register=Registrarse
+UIBannerPortlet.action.register=Registrarse
#############################################################################
#org.exoplatform.portal.webui.component.UIHomePagePortlet #
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_fr.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_fr.properties 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_fr.properties 2010-01-11 10:02:24 UTC (rev 1222)
@@ -26,6 +26,9 @@
UIIFrameEditMode.label.editmode=Edit Mode
UIIFrameEditMode.action.Save=Sauver
+UIBannerPortlet.action.changeLanguage=Changer Langue
+UIBannerPortlet.action.register=S'enregistrer
+
#############################################################################
#org.exoplatform.portal.webui.component.UIHomePagePortlet #
#############################################################################
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ko.xml
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ko.xml 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ko.xml 2010-01-11 10:02:24 UTC (rev 1222)
@@ -18,6 +18,7 @@
<UIBannerPortlet>
<action>
<changeLanguage>언어 변경</changeLanguage>
+ <register>등록</register>
</action>
</UIBannerPortlet>
@@ -30,4 +31,4 @@
<Password>비밀번호:</Password>
</Label>
</UIHomePagePortlet>
-</bundle>
\ No newline at end of file
+</bundle>
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ru.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ru.properties 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_ru.properties 2010-01-11 10:02:24 UTC (rev 1222)
@@ -8,6 +8,7 @@
UIIFrameEditMode.label.editmode=Режим редактирования
UIIFrameEditMode.action.Save=Сохранить
UIBannerPortlet.action.changeLanguage=Изменить язык
+UIBannerPortlet.action.register=Register
#############################################################################
#org.exoplatform.portal.webui.component.UIHomePagePortlet #
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_uk.properties
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_uk.properties 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_uk.properties 2010-01-11 10:02:24 UTC (rev 1222)
@@ -9,6 +9,7 @@
UIIFrameEditMode.action.Save=Зберегти
UIBannerPortlet.action.changeLanguage=Змінити мову
+UIBannerPortlet.action.register=Register
#############################################################################
#org.exoplatform.portal.webui.component.UIHomePagePortlet #
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_vi.xml
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_vi.xml 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/classes/locale/portlet/web/GroovyPortlet_vi.xml 2010-01-11 10:02:24 UTC (rev 1222)
@@ -45,6 +45,7 @@
<UIGroovyPortlet>
<action>
<changeLanguage>Thay ngôn ngữ</changeLanguage>
+ <register>Register</register>
</action>
</UIGroovyPortlet>
</bundle>
Modified: portal/trunk/portlet/web/src/main/webapp/groovy/groovy/webui/component/UIBannerPortlet.gtmpl
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/groovy/groovy/webui/component/UIBannerPortlet.gtmpl 2010-01-11 08:58:38 UTC (rev 1221)
+++ portal/trunk/portlet/web/src/main/webapp/groovy/groovy/webui/component/UIBannerPortlet.gtmpl 2010-01-11 10:02:24 UTC (rev 1222)
@@ -26,7 +26,7 @@
<div class="MiddleLoginContainer Signin">
<a class="Login" onclick="$signInAction"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
<a class="Register" href="$registerURI">
- <%=_ctx.appRes("UIBannerPortlet.action.Register")%>
+ <%=_ctx.appRes("UIBannerPortlet.action.register")%>
</a>
<a class="Language" onclick="$changeLanguageAction">
<%=_ctx.appRes("UIBannerPortlet.action.changeLanguage")%>
14 years, 11 months