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);