[gatein-commits] gatein SVN: r4934 - in portal/branches/branch-GTNPORTAL-1592: web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Nov 4 01:04:10 EDT 2010


Author: hoang_to
Date: 2010-11-04 01:04:09 -0400 (Thu, 04 Nov 2010)
New Revision: 4934

Added:
   portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
   portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java
Modified:
   portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
   portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
   portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
   portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy
   portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
   portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
Log:
GTNPORTAL-1040: Resizing the container in Portal pages does not work correctly

Modified: portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-11-04 05:03:14 UTC (rev 4933)
+++ portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js	2010-11-04 05:04:09 UTC (rev 4934)
@@ -358,10 +358,15 @@
  * @param the dragging object
  */
 PortalDragDrop.prototype.findDropableTargets = function(dragBlock) {
-	var DOMUtil = eXo.core.DOMUtil;
+  var DOMUtil = eXo.core.DOMUtil;
   var dropableTargets = new Array() ;
+  
+  if (dragBlock && DOMUtil.hasClass(dragBlock, "UIColumnContainer")) {
+    var uiTableContainer = eXo.core.DOMUtil.findAncestorByClass(dragBlock, "UITableColumnContainer");
+    dropableTargets.push(uiTableContainer);
+    return dropableTargets;
+  }
   var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
-  
   var pagebody = document.getElementById("UIPageBody");
   if(eXo.portal.portalMode && pagebody) {
 	  var uiPortal = DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace, "div", "UIPortal") ;
@@ -375,6 +380,7 @@
   for(var i = 0; i < uiContainers.length; i++) {
   	if(DOMUtil.hasAncestor(uiContainers[i], dragBlock)) continue;
   	if(DOMUtil.hasClass(uiContainers[i], "ProtectedContainer")) continue;
+  	if (DOMUtil.hasClass(uiContainers[i], "UITableColumnContainer")) continue;
     dropableTargets.push(uiContainers[i]) ;
   }
   return dropableTargets ;

Modified: portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js	2010-11-04 05:03:14 UTC (rev 4933)
+++ portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js	2010-11-04 05:04:09 UTC (rev 4934)
@@ -513,14 +513,17 @@
  */
 UIPortal.prototype.findUIComponentOf = function(element) {
   var DOMUtil = eXo.core.DOMUtil;
-  var parent = element.parentNode ;
-  while(parent != null) {
-    if(DOMUtil.hasClass(parent,'UIPortlet') || DOMUtil.hasClass(parent,'UIContainer') ||  
-       DOMUtil.hasClass(parent,'UIPageBody') ||  DOMUtil.hasClass(parent,'UIPortal'))  {
-      return parent ;
-    }
-    parent = parent.parentNode ;
+  var parent;
+  if (parent = DOMUtil.findAncestorByClass(element, "UIPortlet")) {
+    return parent;
+  } else if (parent = DOMUtil.findAncestorByClass(element, "UIContainer")) {
+    return parent;
+  } else if (parent = DOMUtil.findAncestorByClass(element, "UIPageBody")) {
+    return parent;
+  } else if (parent = DOMUtil.findAncestorByClass(element, "UIPortal")) {
+    return parent;
   }
+  
   return null ;
 };
 /**

Modified: portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css	2010-11-04 05:03:14 UTC (rev 4933)
+++ portal/branches/branch-GTNPORTAL-1592/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css	2010-11-04 05:04:09 UTC (rev 4934)
@@ -189,8 +189,8 @@
 	float: right; /* orientation=rt */
 	width: 22px; height: 16px;
 	background: url('background/Pen.gif') no-repeat top;
-	margin: 4px 2px 0px 0px; /* orientation=lt */
-	margin: 4px 0px 0px 2px; /* orientation=rt */
+	margin: 4px 0px 0px 2px; /* orientation=lt */
+	margin: 4px 2px 0px 0px; /* orientation=rt */
 }
 
 .UIContainer .DeleteContainerIcon {
@@ -213,6 +213,29 @@
 	background: url('background/DefaultContainerIcon.png') no-repeat;
 }
 
+.UIColumnContainer .ControlIcon {
+  float: right;/* orientation=lt */
+  float: left;/* orientation=rt */
+  width: 28px; 
+  height: 20px;
+  cursor: pointer;
+  background: url('/eXoResources/skin/PortletThemes/background/DefaultTheme.png') no-repeat center;
+}
+
+.UIColumnContainer .EditContainerIcon {
+	margin-left: 0px; /* orientation=lt */
+	margin-right: 0px; /* orientation=rt */
+}
+
+.UIColumnContainer .ArrowDownIcon {
+	float: left; /* orientation=lt */
+	float: right; /* orientation=rt */
+	width: 22px; height: 16px; 
+	background: url('background/ArrowDown.gif') no-repeat center top;
+	margin: 4px 0px 0px 2px; /* orientation=lt */
+	margin: 4px 2px 0px 0px; /* orientation=rt */
+}
+
 .UIPortal .LAYOUT-PORTAL {
 	/* background: url('background/PortalBackground4x4.gif');*/
 	background: white;

Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy	2010-11-04 05:03:14 UTC (rev 4933)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy	2010-11-04 05:04:09 UTC (rev 4934)
@@ -46,22 +46,22 @@
     column.addSelectItemOption(new SelectItemOption("oneColumns","" +
         "<container template=\"system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl\">" +
         "  <factory-id>TableColumnContainer</factory-id>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
         "</container>", 
         "OneRowContainerLayout")) ;
     column.addSelectItemOption(new SelectItemOption("twoColumns",
         "<container template=\"system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl\">" +
         "  <factory-id>TableColumnContainer</factory-id>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
         "</container>",
         "TwoColumnContainerLayout")) ;
     column.addSelectItemOption(new SelectItemOption("threeColumns",
         "<container template=\"system:/groovy/portal/webui/container/UITableColumnContainer.gtmpl\">" +
         "  <factory-id>TableColumnContainer</factory-id>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
-        "  <container template=\"system:/groovy/portal/webui/container/UIContainer.gtmpl\"></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
+        "  <container template=\"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl\"><factory-id>ColumnContainer</factory-id></container>" +
         "</container>",
         "ThreeColumnContainerLayout")) ;
   templates.add(column);  

Added: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl	                        (rev 0)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl	2010-11-04 05:04:09 UTC (rev 4934)
@@ -0,0 +1,131 @@
+<%
+	import org.exoplatform.commons.utils.ExpressionUtil;
+	import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+	import org.exoplatform.webui.core.UIComponent;
+	//import org.exoplatform.webui.config.Event;
+	
+	def rcontext = _ctx.getRequestContext();
+	ResourceBundle res = rcontext.getApplicationResourceBundle();
+	
+	UIPortalApplication uiPortalApp = rcontext.getUIApplication();
+	boolean hasPermission = uicomponent.hasPermission();
+	if(!uiPortalApp.isEditing() && !hasPermission) return;
+
+	String cssStyle = "";
+	String uiComponentWidth = uicomponent.getWidth();
+	String uiComponentHeight = uicomponent.getHeight();
+	if(uiComponentWidth != null || uiComponentHeight != null) cssStyle = "style=\"";
+	if(uiComponentHeight != null) cssStyle += "height: "+uiComponentHeight+";"
+	if(cssStyle.length() > 0) cssStyle += "\"";
+	
+	/** Trim the prefix UIContainer- if any, this hardcoded part is needed to update nested container via Ajax */
+	String componentId = uicomponent.getId();
+	if(componentId.startsWith("UIContainer-")){
+		uicomponent.setId(componentId.substring("UIContainer-".length()));
+	}
+%>
+
+<div class="UIContainer UIColumnContainer <%=uiPortalApp.isEditing()?"EdittingContainer":""%> <%=hasPermission?"": "ProtectedContainer"%>" 
+				id="${uicomponent.id}" ${cssStyle} 
+				onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);" 
+				onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+	<div class="NormalContainerBlock">
+		<div class="LeftContainerBlock">
+			<div class="RightContainerBlock UIComponentBlock">
+
+			<%
+				int portalMode = uiPortalApp.getModeState();
+				if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode == UIPortalApplication.APP_BLOCK_EDIT_MODE){
+			%>
+				<div class="LAYOUT-CONTAINER LAYOUT-BLOCK">
+			<%} else {%>
+				<div class="VIEW-CONTAINER VIEW-BLOCK">
+			<%} %> 
+					<%if(hasPermission) {%>
+						<div class="UIRowContainer <%=(portalMode != UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ? "EmptyContainer" : ""%>">
+							<div>
+								<%uicomponent.renderChildren();%>
+							</div>
+						</div>
+						<%} else out.print("<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
+				</div>
+				
+			<%if(portalMode != UIPortalApplication.NORMAL_MODE){%>
+				<div class="EDITION-BLOCK EDITION-CONTAINER" style="display: none;">
+					<div style="position: relative;">
+						<div style="position: absolute; top: -86px;">
+
+							<div class="NewLayer" style="display: none; visibility: hidden;"><span></span></div>
+							<div class="CONTROL-CONTAINER CONTROL-BLOCK" style="position: absolute; top: -6px;">
+								<%/*Begin InfoBar*/%>
+							 	<div class="UIInfoBar">
+									<div class="BlueRoundedStyle">
+										<div class="LeftBar">
+											<div class="RightBar">
+												<div class="MiddleBar">
+													<div class="FixHeight ClearFix">
+														<div class="DragControlArea" title="<%=_ctx.appRes("UIContainer.title.DragControlArea")%>" onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
+														<% 
+															String showCategory = "eXo.webui.UIPopupSelectCategory.show(this, event)";
+															String strTitle = uicomponent.getTitle() != null ?
+																		ExpressionUtil.getExpressionValue(res, uicomponent.getTitle()) :
+																		_ctx.appRes("UIContainer.title.Container");
+														%>
+														<div class="ContainerIcon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
+														<%if(hasPermission) {%>
+															<div class="ControlIcon ArrowDownIcon" onclick="$showCategory" title="<%= _ctx.appRes("UIColumnContainer.tootip.insertColumn") %>">
+																<% /*Begin Popup Menu*/ %>
+																<div style="position: relative; width: 100%">
+																	<div class="UIPopupCategory" style="display: none;">
+																		<div class="PopupCategoryDecorator">
+																			<div class="PopupCategoryTL">
+																				<div class="PopupCategoryTR">
+																					<div class="PopupCategoryTC"><span></span></div>
+																				</div>
+																			</div>
+																			<div class="PopupCategoryML">
+																				<div class="PopupCategoryMR">
+																					<div class="PopupCategoryMC">
+																						<a class="CategoryItem" href="<%= uicomponent.event("InsertColumn", org.exoplatform.portal.webui.container.UIColumnContainer.INSERT_BEFORE) %>"  title="<%= _ctx.appRes("UIColumnContainer.tooltip.insertLeft") %>">
+																							<div class="CategoryItemLabel"><%= _ctx.appRes("UIColumnContainer.label.insertLeft") %></div>
+																						</a>
+																						<a class="CategoryItem" href="<%= uicomponent.event("InsertColumn", org.exoplatform.portal.webui.container.UIColumnContainer.INSERT_AFTER) %>"  title="<%= _ctx.appRes("UIColumnContainer.tooltip.insertRight") %>">
+																							<div class="CategoryItemLabel"><%= _ctx.appRes("UIColumnContainer.label.insertRight") %></div>
+																						</a>
+																					</div>
+																				</div>
+																			</div>
+																			<div class="PopupCategoryBL">
+																				<div class="PopupCategoryBR">
+																					<div class="PopupCategoryBC"><span></span></div>
+																				</div>
+																			</div>
+																		</div>
+																	</div>
+																</div>
+																<% /*End Popup Menu*/ %>
+															</div>
+															<a href="<%=uicomponent.event("EditContainer")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("DeleteComponent")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
+															
+														<%}%>
+													
+													</div>
+												</div>
+											</div>
+										</div>
+									</div>
+								</div>
+								<%/*End InfoBar*/ %>
+							</div>
+							
+						</div>
+					</div>
+				</div>	
+			<%} %>
+				
+			</div>
+		</div>
+	</div> 
+</div>
+

Modified: portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-11-04 05:03:14 UTC (rev 4933)
+++ portal/branches/branch-GTNPORTAL-1592/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl	2010-11-04 05:04:09 UTC (rev 4934)
@@ -16,7 +16,7 @@
 	}
 	
 %>
-<div class="UIContainer <%=uiPortalApp.isEditing()?"EdittingContainer":""%> <%=hasPermission?"":"ProtectedContainer"%>" 
+<div class="UIContainer UITableColumnContainer <%=uiPortalApp.isEditing()?"EdittingContainer":""%> <%=hasPermission?"":"ProtectedContainer"%>" 
 				id="${uicomponent.id}" 
 				onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);" 
 				onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
@@ -39,10 +39,10 @@
 				<%} %>
 					<div>
 						<%if(hasPermission) {%>		
-						<table class="UITableColumnContainer" style="table-layout: fixed; margin: 0px auto; $style">
+						<table class="UITableColumn" style="table-layout: fixed; margin: 0px auto; $style">
 							<tr class="TRContainer">
 								<% for(uiChild in uicomponent.getChildren()) {%>
-									<td class="${uiChild.id}TDContainer TDContainer"><% uicomponent.renderUIComponent(uiChild) %></td>
+									<td class="${uiChild.id}TDContainer TDContainer" width="<%= uiChild.getWidth(); %>"><% uicomponent.renderUIComponent(uiChild) %></td>
 								<% } %>
 						 </tr>
 						</table>

Added: portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java	                        (rev 0)
+++ portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java	2010-11-04 05:04:09 UTC (rev 4934)
@@ -0,0 +1,108 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ * 
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ * 
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.portal.webui.container;
+
+import java.util.Collections;
+import java.util.List;
+
+import org.exoplatform.portal.application.PortalRequestContext;
+import org.exoplatform.portal.webui.container.UIContainerActionListener.EditContainerActionListener;
+import org.exoplatform.portal.webui.portal.UIPortalComponent;
+import org.exoplatform.portal.webui.portal.UIPortalComponentActionListener.DeleteComponentActionListener;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.portal.webui.workspace.UIWorkingWorkspace;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+
+/**
+ * Created by The eXo Platform SAS
+ * Author : Nguyen Duc Khoi
+ *          khoi.nguyen at exoplatform.com
+ * Jul 29, 2010  
+ */
+
+ at ComponentConfig(template = "system:/groovy/portal/webui/container/UIColumnContainer.gtmpl", events =
+{
+      @EventConfig(listeners = UIColumnContainer.InsertColumnActionListener.class),
+      @EventConfig(listeners = DeleteComponentActionListener.class, confirm = "UIColumnContainer.deleteColumnContainer"),
+      @EventConfig(listeners = EditContainerActionListener.class)})
+public class UIColumnContainer extends UIContainer
+{
+   public static final String COLUMN_CONTAINER = "ColumnContainer";
+
+   public static final String INSERT_AFTER = "insertColumnAfter";
+
+   public static final String INSERT_BEFORE = "insertColumnBefore";
+
+   public UIColumnContainer()
+   {
+      super();
+   }
+
+   public static class InsertColumnActionListener extends EventListener<UIColumnContainer>
+   {
+      @Override
+      public void execute(Event<UIColumnContainer> event) throws Exception
+      {
+         String insertPosition = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
+         UIColumnContainer uiSelectedColumn = event.getSource();
+         UIPortalComponent uiParent = (UIPortalComponent) uiSelectedColumn.getParent();
+         if (insertPosition.equals(INSERT_AFTER))
+         {
+            UIColumnContainer.insertColumn(uiSelectedColumn, true);
+         }
+         else if (insertPosition.equals(INSERT_BEFORE))
+         {
+            UIColumnContainer.insertColumn(uiSelectedColumn, false);
+         }
+
+         Util.showComponentLayoutMode(uiSelectedColumn.getClass());
+
+         PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
+         UIPortalApplication uiPortalApp = uiParent.getAncestorOfType(UIPortalApplication.class);
+         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
+         pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
+         pcontext.setFullRender(true);
+      }
+
+   }
+
+   private static void insertColumn(UIColumnContainer selectedColumn, boolean isInsertAfter) throws Exception
+   {
+      UIContainer uiParent = selectedColumn.getParent();
+      UIColumnContainer uiNewColumn = uiParent.addChild(UIColumnContainer.class, null, null);
+
+      uiNewColumn.setTemplate(selectedColumn.getTemplate());
+      uiNewColumn.setFactoryId(selectedColumn.getFactoryId());
+      uiNewColumn.setId(String.valueOf(uiNewColumn.hashCode()));
+
+      List<UIComponent> listColumn = uiParent.getChildren();
+      int position = listColumn.indexOf(selectedColumn);
+      if (isInsertAfter)
+      {
+         position += 1;
+      }
+      Collections.rotate(listColumn.subList(position, listColumn.size()), 1);
+   }
+
+}
\ No newline at end of file

Modified: portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java	2010-11-04 05:03:14 UTC (rev 4933)
+++ portal/branches/branch-GTNPORTAL-1592/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java	2010-11-04 05:04:09 UTC (rev 4934)
@@ -33,6 +33,7 @@
 import org.exoplatform.portal.webui.application.PortletState;
 import org.exoplatform.portal.webui.application.UIGadget;
 import org.exoplatform.portal.webui.application.UIPortlet;
+import org.exoplatform.portal.webui.container.UIColumnContainer;
 import org.exoplatform.portal.webui.container.UIContainer;
 import org.exoplatform.portal.webui.container.UITabContainer;
 import org.exoplatform.portal.webui.page.UIPage;
@@ -412,6 +413,10 @@
          {
             uiTempContainer = uiContainer.createUIComponent(context, UITabContainer.class, null, null);
          }
+         else if (UIColumnContainer.COLUMN_CONTAINER.equals(container.getFactoryId()))
+         {
+            uiTempContainer = uiContainer.createUIComponent(context, UIColumnContainer.class, null, null);
+         }
          else
          {
             uiTempContainer = uiContainer.createUIComponent(context, UIContainer.class, null, null);



More information about the gatein-commits mailing list