[gatein-commits] gatein SVN: r2438 - portal/branches/EPP_5_0_Branch/web/portal/src/main/webapp/groovy/portal/webui/container.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Apr 1 05:15:17 EDT 2010


Author: thomas.heute at jboss.com
Date: 2010-04-01 05:15:16 -0400 (Thu, 01 Apr 2010)
New Revision: 2438

Added:
   portal/branches/EPP_5_0_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl
Log:
JBEPP-203: Blank zone when user put permission on Container in a page / Content should be filled up automatically

Added: portal/branches/EPP_5_0_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl
===================================================================
--- portal/branches/EPP_5_0_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	                        (rev 0)
+++ portal/branches/EPP_5_0_Branch/web/portal/src/main/webapp/groovy/portal/webui/container/UITableAutofitColumnContainer.gtmpl	2010-04-01 09:15:16 UTC (rev 2438)
@@ -0,0 +1,98 @@
+<%	
+	import org.exoplatform.commons.utils.ExpressionUtil;
+	import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+	
+	def rcontext = _ctx.getRequestContext(); 
+	ResourceBundle res = rcontext.getApplicationResourceBundle(); 
+	
+	UIPortalApplication uiPortalApp = rcontext.getUIApplication();
+	boolean hasPermission = uicomponent.hasPermission();
+	if(!uiPortalApp.isEditing() && !hasPermission) return;
+	
+	/** 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 <%=uiPortalApp.isEditing()?"EdittingContainer":""%> <%=hasPermission?"":"ProtectedContainer"%>" 
+				id="UIContainer-${uicomponent.id}" 
+				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();
+					String style = "";
+					String width	= uicomponent.getWidth();
+					String height	= uicomponent.getHeight();
+					if(width != null) style += "width:"+width+";";
+					if(height != null) style += "height:"+height+";";
+					if(portalMode == uiPortalApp.CONTAINER_BLOCK_EDIT_MODE || portalMode == uiPortalApp.APP_BLOCK_EDIT_MODE){
+				%>
+				<div class="LAYOUT-CONTAINER LAYOUT-BLOCK">
+				<%} else {%>
+				<div class="VIEW-CONTAINER VIEW-BLOCK">
+				<%} %>
+					<div id="$uicomponent.id">
+						<%if(hasPermission) {%>		
+						<table class="UITableColumnContainer" style="margin: 0px auto; $style">
+							<tr class="TRContainer">
+								<% for(uiChild in uicomponent.getChildren()) {%>
+									<td class="${uiChild.id}TDContainer TDContainer"><% uicomponent.renderUIComponent(uiChild) %></td>
+								<% } %>
+						 </tr>
+						</table>
+						<%} else {print "<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";}%>
+					</div>		
+				</div>
+				<%/*Debug On IE	-----For DND */%>
+				
+				<%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">
+														<div class="DragControlArea" title="<%=_ctx.appRes("UIContainer.tooltip.drag")%>" 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 DefaultContainer16x16Icon"><%=hasPermission ? strTitle : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
+														<%if(hasPermission) {%>
+															<a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeleteContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.closeContainer")%>"><span></span></a>
+															<a href="<%=uicomponent.event("EditContainer","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditContainerIcon" title="<%=_ctx.appRes("UIContainer.tooltip.editContainer")%>"><span></span></a>
+														<%}%>
+														<div class="ClearBoth"><span></span></div>
+													</div>
+												</div>
+											</div>
+										</div>
+									</div>
+								</div>
+								<%/*End InfoBar*/ %>
+							</div>
+							
+						</div>
+					</div>
+				</div>
+				<%} %>
+				
+			</div>
+		</div>
+	</div>	
+	
+</div>
\ No newline at end of file



More information about the gatein-commits mailing list