Author: hfnukal
Date: 2012-07-03 05:48:58 -0400 (Tue, 03 Jul 2012)
New Revision: 8764
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainer.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
Log:
Bug806219 revert changes
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2012-07-03
09:48:58 UTC (rev 8764)
@@ -354,15 +354,10 @@
* @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") ;
@@ -376,7 +371,6 @@
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 ;
@@ -492,4 +486,4 @@
}
};
-eXo.portal.PortalDragDrop = new PortalDragDrop() ;
+eXo.portal.PortalDragDrop = new PortalDragDrop() ;
\ No newline at end of file
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2012-07-03
09:48:58 UTC (rev 8764)
@@ -513,17 +513,14 @@
*/
UIPortal.prototype.findUIComponentOf = function(element) {
var DOMUtil = eXo.core.DOMUtil;
- 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;
+ 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 ;
}
-
return null ;
};
/**
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2012-07-03
09:48:58 UTC (rev 8764)
@@ -1,239 +1,119 @@
-/**
- * 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.
- */
-
-.UIPortlet .LAYOUT-BLOCK {
- padding: 5px;
-}
-
-.UIPortlet .CONTROL-PORTLET {
- left: 0; /* orientation=lt */
- right: 0; /* orientation=rt */
-}
-
-.UIPortlet .CONTROL-PORTLET .Login {
- background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/ToolIcons/Key.gif')
no-repeat center;
-}
-
-.UIPortlet .CONTROL-PORTLET .DragControlArea {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- width: 7px; height: 13px;
- margin: 5px 0px 0px 3px; /* orientation=lt */
- margin: 5px 3px 0px 0px; /* orientation=rt */
- background: url('background/DragBg2x2.gif');
- cursor: move;
-}
-
-.UIPortlet .ViewPortletIcon {
- float: right; /* orientation=lt */
- float: left; /* orientation=rt */
- width: 16px; height: 16px;
- margin: 4px 5px 0px 0px; /* orientation=lt */
- margin: 4px 0px 0px 5px; /* orientation=rt */
- background: url('background/BlueBoxLight.gif') no-repeat;
- cursor: pointer;
-}
-
-.UIPortlet .EditPortletPropertiesIcon {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- width: 20px; height: 20px;
- background: url('background/Pen.gif') no-repeat top;
- margin: 4px 0px 0px 5px; /* orientation=lt */
- margin: 4px 5px 0px 0px; /* orientation=rt */
-}
-
-.UIPortlet .DeletePortletIcon {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- width: 20px; height:20px;
- background: url('background/Close.gif') no-repeat bottom;
- margin: 0px 0px 0px 2px; /* orientation=lt */
- margin: 0px 2px 0px 0px; /* orientation=rt */
-}
-
-.UIPortlet .SelectedContainerBlock {
+.UIPortal .LAYOUT-PORTAL {
background: white;
- border-top: 1px solid #91bcdd;
+ padding: 8px;
+ _padding: 8px 0px; /* orientation=rt */
+ margin: auto;
+ _margin: 0px; /* orientation=rt */
+ _width: 99%; /* orientation=rt */
}
-.UIPortlet .SelectedContainerBlock .LeftContainerBlock {
- background: url('background/BgContainerBlock.gif') no-repeat left top;
- padding-left: 1px;
+.DragAndDropPreview {
+ width: auto; height: 80px;
+ background: url('background/DragAndDropPreview4x4.gif');
+ border: 1px solid #c4c4c4;
+ margin: 0px 12px 10px 12px;
}
-.UIPortlet .SelectedContainerBlock .RightContainerBlock {
- background: url('background/BgContainerBlock.gif') no-repeat right top;
- padding: 4px;
-}
+/************** style for EDITION-BLOCK *****************/
-.UIPortlet .NewLayer {
- background: #d1dce5;
- filter: alpha(opacity=80);
- opacity: 0.8;
- width: 100%; height: 100%;
+.EDITION-BLOCK .CONTROL-BLOCK {
+ position: absolute;
+ top: -5px;
+ left: 4px; /* orientation=lt */
+ right: 4px; /* orientation=rt */
+ white-space: nowrap;
}
-/*##############################-
PortletLayoutDecorator -################################*/
-
-.PortletLayoutDecorator {
-}
-
-.PortletLayoutDecorator .LPortletLayoutDecorator {
- background: url('background/PortletLayoutDecorator.gif') no-repeat left top;
- padding: 0px 0px 0px 12px;
-}
-
-.PortletLayoutDecorator .RPortletLayoutDecorator {
- background: url('background/PortletLayoutDecorator.gif') no-repeat right top;
- padding-right: 12px;
-}
-
-.PortletLayoutDecorator .CPortletLayoutDecorator {
- background: url('background/PortletLayoutDecorator.gif') repeat-x center -89px;
-}
-
-.PortletLayoutDecorator .FixHeight {
- height: 69px;
- padding: 10px 0;
-}
-.ProtectedPortlet .PortletLayoutDecorator {
- background: white;
-}
-.ProtectedPortlet .PortletLayoutDecorator .LPortletLayoutDecorator {
- opacity: 0.3;
- filter: alpha(opacity=30);
-}
-/*############### End Decorator ###################################################*/
-
-.LAYOUT-CONTAINER .UIContainer {
- height: 100%;
- /*
- fix bug dragdrop in IE6
- */
-}
-
-.LAYOUT-CONTAINER .TDContainer {
- padding: 0px 2px;
-}
-
-.UIContainer .LAYOUT-BLOCK .UIRowContainer {
- min-height: 86px;
- _height: 86px;
-}
-
-.UIContainer .VIEW-BLOCK .EmptyContainer {
- height: 82px;
-}
-
-.UIContainer .NewLayer {
+.EDITION-BLOCK .NewLayer {
background: #93c0e2;
filter: alpha(opacity=40);
opacity: 0.4;
width: 100%; height: 100%;
}
-/*
-.UIContainer .LAYOUT-CONTAINER {
- background: #f5f5f5;
- border: solid 1px #38acf3;
- padding: 5px;
- margin: 0px 1px;
- min-height: 60px;
-}
-
-* html .UIContainer .LAYOUT-CONTAINER {
- height: 60px;
-}
-
-.UIContainer .UIInfoBar .BlueRoundedStyle {
- padding: 0px; margin: 0px;
- height: 22px;
-}
-*/
-
-.UIContainer .CONTROL-CONTAINER .DragControlArea {
+.EDITION-BLOCK .DragControlArea {
float: left; /* orientation=lt */
float: right; /* orientation=rt */
width: 7px; height: 13px;
background: url('background/DragBg2x2.gif');
cursor: move;
- margin: 5px 0px 0px 2px; /* orientation=lt */
- margin: 5px 2px 0px 0px; /* orientation=rt */
+ margin: 3px 0px 0px 2px; /* orientation=lt */
+ margin: 3px 2px 0px 0px; /* orientation=rt */
+ display: block;
}
-.UIContainer .LAYOUT-CONTAINER .UITableColumnContainer {
- background: none;
- border: none;
- margin: auto;
-}
-
-.UIContainer .EditContainerIcon {
+.EDITION-BLOCK .EditIcon {
float: left; /* orientation=lt */
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: 2px 2px 0px 0px; /* orientation=lt */
+ margin: 2px 0px 0px 2px; /* orientation=rt */
}
-.UIContainer .DeleteContainerIcon {
+.EDITION-BLOCK .DeleteIcon {
float: left; /* orientation=lt */
float: right; /* orientation=rt */
width: 22px; height: 16px;
background: url('background/Close.gif') no-repeat bottom;
- margin: 4px 0px 0px 0px; /* orientation=lt */
- margin: 4px 0px 0px 0px; /* orientation=rt */
+ margin: 2px 0px 0px 0px; /* orientation=lt */
+ margin: 2px 0px 0px 0px; /* orientation=rt */
}
-.UIContainer .ContainerIcon {
+.EDITION-BLOCK .ContainerIcon {
float: left; /* orientation=lt */
float: right; /* orientation=rt */
- height: 16px; line-height: 16px;
padding-left: 24px; /* orientation=lt */
padding-right: 24px; /* orientation=rt */
- margin: 3px 0px 0px 5px; /* orientation=lt */
- margin: 3px 5px 0px 0px; /* orientation=rt */
- background: url('background/DefaultContainerIcon.png') no-repeat;
+ margin: 0px 0px 0px 5px; /* orientation=lt */
+ margin: 0px 5px 0px 0px; /* orientation=rt */
+ background: url('background/DefaultContainerIcon.gif') no-repeat left 3px; /*
orientation=lt */
+ background: url('background/DefaultContainerIcon.gif') no-repeat right 1px; /*
orientation=rt */
}
-.UIPortal .LAYOUT-PORTAL {
- /* background: url('background/PortalBackground4x4.gif');*/
- background: white;
- padding: 8px;
- _padding: 8px 0px; /* orientation=rt */
- margin: auto;
- _margin: 0px; /* orientation=rt */
- _width: 99%; /* orientation=rt */
+.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;
}
-.DragAndDropPreview {
- width: auto; height: 80px;
- background: url('background/DragAndDropPreview4x4.gif');
- border: 1px solid #c4c4c4;
- margin: 0px 12px 10px 12px;
+.UIColumnContainer .ArrowDownIcon {
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ width: 22px; height: 16px;
+ background: url('background/ArrowDown.gif') no-repeat center top;
+ margin: 3px 0px 0px 2px; /* orientation=lt */
+ margin: 3px 2px 0px 0px; /* orientation=rt */
}
-.PortletBlockDecorator {
+.EDITION-BLOCK .PortletIcon {
+ background: url('background/Earth.gif') no-repeat left center; /* orientation=lt
*/
+ background: url('background/Earth.gif') no-repeat right center; /*
orientation=rt */
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ text-overflow: ellipsis;
+ width: auto;
+ line-height: 19px;
+ padding-left: 25px; /* orientation=lt */
+ padding-right: 25px; /* orientation=rt */
+ margin: 0px 0px 0px 6px; /* orientation=lt */
+ margin: 0px 6px 0px 0px; /* orientation=rt */
+ color: black;
+}
+/****************** edit Application *********************/
+.UIPortlet .LAYOUT-BLOCK {
+ padding: 2px;
}
+.UIPortlet .CONTROL-PORTLET .Login {
+ background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/ToolIcons/Key.gif')
no-repeat center;
+}
+
+/****************** edit Container *********************/
.EdittingContainer {
padding: 3px;
}
@@ -242,44 +122,54 @@
background: white;
border: 1px dashed #a2a2a2;
height: 100%;
+ padding: 2px;
}
+.EdittingContainer .OverContainerBlock {
+ border: 1px solid #b8babf;
+ background: white;
+ height: 100%;
+ padding: 2px;
+}
-.EdittingContainer .NormalContainerBlock .LeftContainerBlock,
-.EdittingContainer .OverContainerBlock .NormalContainerBlock .LeftContainerBlock {
- background: none;
+.EdittingContainer .LAYOUT-BLOCK .UIRowContainer {
+ min-height: 86px;
+ _height: 86px;
}
-.EdittingContainer .NormalContainerBlock .RightContainerBlock,
-.EdittingContainer .OverContainerBlock .NormalContainerBlock .RightContainerBlock {
- padding: 2px;
- background: none;
+.EdittingContainer .VIEW-BLOCK .EmptyContainer {
+ height: 82px;
}
-.UIContainer .UIPortlet {
- padding: 0px;
+.EdittingContainer .LAYOUT-CONTAINER .UIContainer {
+ _height: 100%;
+ /*
+ fix bug dragdrop in IE6
+ */
}
-.UIPortletMask {
- opacity: 0;
- filter: alpha(opacity=0);
- background: #ffffff;
+/*##############################-
PortletLayoutDecorator -################################*/
+
+.PortletLayoutDecorator {
}
-.EdittingContainer .OverContainerBlock {
- border: 1px solid #b8babf;
- background: none;
- height: 100%;
+.PortletLayoutDecorator .LPortletLayoutDecorator {
+ background: url('background/PortletLayoutDecorator.gif') no-repeat left top;
+ padding: 0px 0px 0px 12px;
}
-.EdittingContainer .OverContainerBlock .LeftContainerBlock {
- background: white;
+.PortletLayoutDecorator .RPortletLayoutDecorator {
+ background: url('background/PortletLayoutDecorator.gif') no-repeat right top;
+ padding-right: 12px;
}
-.EdittingContainer .OverContainerBlock .RightContainerBlock {
- background: none;
- padding: 2px;
+.PortletLayoutDecorator .CPortletLayoutDecorator {
+ background: url('background/PortletLayoutDecorator.gif') repeat-x center -89px;
+ height: 69px;
+ padding: 10px 0;
}
+/*############### End Decorator ###################################################*/
+
.ProtectedContainer .ProtectedContent {
opacity: 0.3;
filter: alpha(opacity=80);
@@ -287,6 +177,21 @@
padding: 6px 10px;
}
+.ProtectedPortlet .PortletLayoutDecorator {
+ background: white;
+}
+
+.ProtectedPortlet .PortletLayoutDecorator .LPortletLayoutDecorator {
+ opacity: 0.3;
+ filter: alpha(opacity=30);
+}
+
+.UIPortletMask {
+ opacity: 0;
+ filter: alpha(opacity=0);
+ background: #ffffff;
+}
+
.UIPageBodyMask {
opacity: 0;
filter: alpha(opacity=0);
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/uiconf/portal/webui/container/ContainerConfigOption.groovy 2012-07-03
09:48:58 UTC (rev 8764)
@@ -145,4 +145,4 @@
"OneRow2Column1RowContainerLayout")) ;
templates.add(mixed);
-return templates;
+return templates;
\ No newline at end of file
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UIColumnContainer.gtmpl 2012-07-03
09:48:58 UTC (rev 8764)
@@ -1,6 +1,7 @@
<%
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();
@@ -24,78 +25,79 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>
<%=hasPermission?"": "ProtectedContainer"%>"
+<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">
+ <div class="NormalContainerBlock UIComponentBlock">
<%
int portalMode = uiPortalApp.getModeState();
- if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode ==
uiPortalApp.APP_BLOCK_EDIT_MODE){
+ 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>
- <%
- System.out.print("\n\n\n\n\n\nRun first render \n\n\n\n\n");
- uicomponent.renderChildren();
- System.out.print("\n\n\n\n\n\nRun after render\n\n\n\n\n");
- %>
-
- </div>
+ <div>
+ <div class="UIRowContainer <%=(portalMode !=
UIPortalApplication.NORMAL_MODE && uicomponent.getChildren().size() == 0) ?
"EmptyContainer" : ""%>">
+ <%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 class="EDITION-BLOCK EDITION-CONTAINER" style="position:
relative; display: none;">
+
<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;">
+ <div class="CONTROL-CONTAINER CONTROL-BLOCK UIInfoBar"
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 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) {%>
- <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 class="BlueRoundedStyle FixHeight ClearFix">
+
+ <span class="DragControlArea"
title="<%=_ctx.appRes("UIColumnContainer.title.DragControlArea")%>"
onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"></span>
+ <%
+ String showCategory = "eXo.webui.UIPopupSelectCategory.show(this,
event)";
+ String strTitle = uicomponent.getTitle() != null ?
+ ExpressionUtil.getExpressionValue(res, uicomponent.getTitle()) :
+ _ctx.appRes("UIColumnContainer.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.tooltip.insertColumn") %>">
+ <% /*Begin Popup Menu*/ %>
+ <div style="position: relative; width: 100%">
+ <div class="UIPopupCategory" style="display:
none;">
+ <div class="PopupCategoryDecorator">
+
+ <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>
+ <% /*End Popup Menu*/ %>
</div>
- </div>
+ <a
href="<%=uicomponent.event("EditContainer")%>;eXo.portal.UIPortal.changeComposerSaveButton()"
class="EditIcon"
title="<%=_ctx.appRes("UIColumnContainer.tooltip.editContainer")%>"><span></span></a>
+ <a
href="<%=uicomponent.event("DeleteComponent")%>"
class="DeleteIcon"
title="<%=_ctx.appRes("UIColumnContainer.tooltip.closeContainer")%>"><span></span></a>
+
+ <%}%>
+
</div>
- </div>
<%/*End InfoBar*/ %>
</div>
</div>
- </div>
+
</div>
<%} %>
-
- </div>
- </div>
+
</div>
</div>
-
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIColumnContainer.java 2012-07-03
09:48:58 UTC (rev 8764)
@@ -1,44 +1,108 @@
-/*
- * Copyright (C) 2003-2010 eXo Platform SAS.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
+/**
+ * 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ * 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(a)exoplatform.com
- * Jun 1, 2010
+ * Jul 29, 2010
*/
-@ComponentConfig( events = {
- @EventConfig(listeners = EditContainerActionListener.class),
- @EventConfig(listeners = DeleteComponentActionListener.class)
-})
+@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 COLUMN_CONTAINER_TEMPLATE =
"system:/groovy/portal/webui/container/UIColumnContainer.gtmpl";
-
+
+ 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.ignoreAJAXUpdateOnPortlets(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:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainer.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainer.java 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainer.java 2012-07-03
09:48:58 UTC (rev 8764)
@@ -32,7 +32,6 @@
public class UIContainer extends UIPortalComponent
{
public static final String TABLE_COLUMN_CONTAINER = "TableColumnContainer";
- public static final String CONTAINER_TEMPLATE =
"system:/groovy/portal/webui/container/UIContainer.gtmpl";
/** Storage id. */
private String storageId;
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2012-07-03
09:48:58 UTC (rev 8764)
@@ -32,7 +32,6 @@
import org.exoplatform.portal.mop.SiteType;
import org.exoplatform.portal.webui.application.PortletState;
import org.exoplatform.portal.webui.application.UIPortlet;
-import org.exoplatform.portal.webui.container.UIColumnContainer;
import org.exoplatform.portal.webui.container.UITabContainer;
import org.exoplatform.portal.webui.login.UILogin;
import org.exoplatform.portal.webui.login.UIResetPassword;
@@ -60,8 +59,6 @@
import java.util.List;
-import javax.faces.component.UIColumn;
-
/** Author : Nhu Dinh Thuan nhudinhthuan(a)yahoo.com Jun 14, 2006 */
public class UIPortalComponentActionListener
{
@@ -282,10 +279,6 @@
accessPers = new String[]{UserACL.EVERYONE};
uiContainer.setAccessPermissions(accessPers);
uiSource = uiContainer;
-
if(org.exoplatform.portal.webui.container.UIContainer.TABLE_COLUMN_CONTAINER.equals(((org.exoplatform.portal.webui.container.UIContainer)uiTarget).getFactoryId())
&& uiSource instanceof org.exoplatform.portal.webui.container.UIContainer)
- {
-
((org.exoplatform.portal.webui.container.UIContainer)uiSource).setTemplate(UIColumnContainer.COLUMN_CONTAINER_TEMPLATE);
- }
}
else
{
@@ -348,16 +341,6 @@
DataStorage storage = uiApp.getApplicationComponent(DataStorage.class);
uiPortlet.setShowInfoBar(storage.getPortalConfig(currentPortal.getSiteKey().getTypeName(),
currentPortal.getSiteKey().getName()).isShowInfobar());
uiSource = uiPortlet;
- if
(org.exoplatform.portal.webui.container.UIContainer.TABLE_COLUMN_CONTAINER.equals(((org.exoplatform.portal.webui.container.UIContainer)uiTarget).getFactoryId()))
- {
-
- org.exoplatform.portal.webui.container.UIContainer uiWraper =
this.createContainerWraper(uiSource, uiTarget);
- List<UIComponent> children = uiTarget.getChildren();
- uiWraper.setTemplate(UIColumnContainer.COLUMN_CONTAINER_TEMPLATE);
- uiWraper.setParent(uiTarget);
- children.add(position, uiWraper);
- return;
- }
}
List<UIComponent> children = uiTarget.getChildren();
uiSource.setParent(uiTarget);
@@ -385,6 +368,8 @@
return;
}
+ uiTarget.getChildren().add(position, uiSource);
+ uiSource.setParent(uiTarget);
if (UITabContainer.TAB_CONTAINER.equals(uiParent.getFactoryId()))
{
@@ -406,72 +391,16 @@
pcontext.addUIComponentToUpdateByAjax(uiParent);
}
}
- else if
(org.exoplatform.portal.webui.container.UIContainer.TABLE_COLUMN_CONTAINER.equals(((org.exoplatform.portal.webui.container.UIContainer)uiTarget).factoryId))
+ else if
(org.exoplatform.portal.webui.container.UIContainer.TABLE_COLUMN_CONTAINER.equals(uiParent
+ .getFactoryId()) && uiParent.getChildren().size() == 1)
{
- portalComposer.updateWorkspaceComponent();
- pcontext.setFullRender(true);
- if (uiSource instanceof org.exoplatform.portal.webui.container.UIContainer)
- {
-
((org.exoplatform.portal.webui.container.UIContainer)uiSource).setTemplate(UIColumnContainer.COLUMN_CONTAINER_TEMPLATE);
-
((org.exoplatform.portal.webui.container.UIContainer)uiSource).setFactoryId(UIColumnContainer.COLUMN_CONTAINER);
- }
- else
- {
- org.exoplatform.portal.webui.container.UIContainer uiWraper =
this.createContainerWraper(uiSource, uiTarget);
- List<UIComponent> children = uiTarget.getChildren();
- uiWraper.setTemplate(UIColumnContainer.COLUMN_CONTAINER_TEMPLATE);
- uiWraper.setParent(uiTarget);
- children.add(position, uiWraper);
- uiParent.getChildren().remove(uiSource);
- return;
- }
- uiParent.getChildren().remove(uiSource);
+ removeUIComponent(uiParent, pcontext, false);
}
- else if
(org.exoplatform.portal.webui.container.UIContainer.TABLE_COLUMN_CONTAINER.equals(uiParent.getFactoryId()))
- {
-
((org.exoplatform.portal.webui.container.UIContainer)uiSource).setTemplate("system:/groovy/portal/webui/container/UIContainer.gtmpl");
-
((org.exoplatform.portal.webui.container.UIContainer)uiSource).setFactoryId(null);
-
- if (uiParent.getChildren().size() == 1)
- {
- removeUIComponent(uiParent, pcontext, false);
- }
- else
- {
- uiParent.getChildren().remove(uiSource);
- }
- }
-
else
{
uiParent.getChildren().remove(uiSource);
}
-
- uiTarget.getChildren().add(position, uiSource);
- uiSource.setParent(uiTarget);
}
-
- private org.exoplatform.portal.webui.container.UIContainer
createContainerWraper(UIComponent uiSource, UIContainer uiParent) throws Exception
- {
- org.exoplatform.portal.webui.container.UIContainer uiContainer =
uiParent.createUIComponent(org.exoplatform.portal.webui.container.UIContainer.class, null,
null);
- List<UIComponent> children = uiContainer.getChildren();
- if(uiSource instanceof UIPortlet)
- {
- ((UIPortlet) uiSource).setShowEditControl(true);
- }
- children.add(uiSource);
- uiSource.setParent(uiContainer);
- String[] accessPers = uiContainer.getAccessPermissions();
- for (String accessPer : accessPers)
- {
- if (accessPer.equals(""))
- accessPer = null;
- }
- if (accessPers == null || accessPers.length == 0)
- accessPers = new String[]{UserACL.EVERYONE};
- uiContainer.setAccessPermissions(accessPers);
- return uiContainer;
- }
}
public static class ChangeLanguageActionListener extends
EventListener<UIPortal>
Modified:
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java 2012-07-03
09:47:50 UTC (rev 8763)
+++
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/util/PortalDataMapper.java 2012-07-03
09:48:58 UTC (rev 8764)
@@ -34,7 +34,6 @@
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,10 +411,6 @@
{
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);