Author: tan_pham_dinh
Date: 2010-02-24 05:58:16 -0500 (Wed, 24 Feb 2010)
New Revision: 1837
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ko.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_nl.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl
Log:
GTNPORTAL-715: implement enhancement permission for container and portlet
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js 2010-02-24
10:58:16 UTC (rev 1837)
@@ -331,13 +331,11 @@
* and clean the array
*/
Browser.prototype.onLoad = function() {
- try {
- var callback = eXo.core.Browser.onLoadCallback ;
- for(var name in callback.properties) {
- var method = callback.get(name) ;
- if (typeof(method) == "function") method() ;
- }
- } catch(e) {}
+ var callback = eXo.core.Browser.onLoadCallback ;
+ for(var name in callback.properties) {
+ var method = callback.get(name) ;
+ if (typeof(method) == "function") try{method()}catch(e){};
+ }
this.onLoadCallback = new eXo.core.HashMap();
} ;
/**
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/PortalDragDrop.js 2010-02-24
10:58:16 UTC (rev 1837)
@@ -196,12 +196,12 @@
if(dndEvent.foundTargetObject != null || (dndEvent.backupMouseEvent &&
dndEvent.backupMouseEvent.keyCode != 27)) {
eXo.portal.PortalDragDrop.doDropCallback(dndEvent) ;
} else {
+ if(dndEvent.dragObject.parentNode.nodeName.toLowerCase() == "td") {
+ dndEvent.dragObject.parentNode.style.width = "auto";
+ }
if(!dndEvent.dragObject.isComponent) {
dndEvent.dragObject.parentNode.removeChild(dndEvent.dragObject) ;
}
- if(dndEvent.dragObject.parentNode.nodeName.toLowerCase() == "td") {
- dndEvent.dragObject.parentNode.style.width = "auto";
- }
// fix bug WEBOS-196
dndEvent.dragObject.style.width = "auto" ;
}
@@ -288,19 +288,22 @@
/* Find components in dropable target */
PortalDragDrop.prototype.findDropableTargets = function(dragBlock) {
+ var DOMUtil = eXo.core.DOMUtil;
var dropableTargets = new Array() ;
var uiWorkingWorkspace = document.getElementById("UIWorkingWorkspace") ;
- var uiPortal = eXo.core.DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace,
"div", "UIPortal") ;
+
+ var uiPortal = DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace, "div",
"UIPortal") ;
var pagebody = document.getElementById("UIPageBody");
- var uiContainers = eXo.core.DOMUtil.findDescendantsByClass(uiWorkingWorkspace,
"div", "UIContainer") ;
+ var uiContainers = DOMUtil.findDescendantsByClass(uiWorkingWorkspace, "div",
"UIContainer") ;
if(eXo.portal.portalMode && pagebody) {
dropableTargets.push(uiPortal) ;
} else {
- var uiPage = eXo.core.DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace,
"div", "UIPage") ;
+ var uiPage = DOMUtil.findFirstDescendantByClass(uiWorkingWorkspace, "div",
"UIPage") ;
if(uiPage) dropableTargets.push(uiPage) ;
}
for(var i = 0; i < uiContainers.length; i++) {
- if (eXo.core.DOMUtil.hasAncestor(uiContainers[i], dragBlock)) continue;
+ if (DOMUtil.hasAncestor(uiContainers[i], dragBlock)) continue;
+ if(DOMUtil.hasClass(uiContainers[i], "ProtectedContainer")) continue;
dropableTargets.push(uiContainers[i]) ;
}
return dropableTargets ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-02-24
10:58:16 UTC (rev 1837)
@@ -22,7 +22,7 @@
this.node = node ;
this.type = node.className ;
var DOMUtil = eXo.core.DOMUtil;
- componentBlock = DOMUtil.findFirstDescendantByClass(node, "div",
"UIComponentBlock");
+ var componentBlock = DOMUtil.findFirstDescendantByClass(node, "div",
"UIComponentBlock");
var children = DOMUtil.getChildrenByTagName(componentBlock, "div") ;
for(var i=0; i<children.length; i++) {
Modified:
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIWorkspace.js 2010-02-24
10:58:16 UTC (rev 1837)
@@ -30,6 +30,7 @@
};
eXo.portal.UIWorkingWorkspace.onResize = function() {
+ throw new Error("Test");
var uiWorkspace = document.getElementById(eXo.portal.UIWorkingWorkspace.id) ;
if(eXo.core.Browser.isIE6()) {
var tabs = eXo.core.DOMUtil.findFirstDescendantByClass(uiWorkspace, "div",
"UIHorizontalTabs") ;
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ar.xml 2010-02-24
10:58:16 UTC (rev 1837)
@@ -1333,6 +1333,7 @@
<UIPortlet>
<label>
<portletContent>وصف المدخل</portletContent>
+ <protectedContent>Protected Content</protectedContent>
<View>عرض</View>
</label>
<lable>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_de.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -781,6 +781,7 @@
#############################################################################
UIPortlet.label.portlet=Portlet
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.title=Portlet
UIPortlet.label.description=GateIn portlet
UIPortlet.label.portletContent=Portlet-Beschreibung
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_en.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -775,6 +775,7 @@
#############################################################################
UIPortlet.label.portletContent=Portlet Description
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=View
UIPortlet.lable.information=Done
UIPortlet.deletePortlet=Are you sure you want to delete this portlet?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_es.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -769,6 +769,7 @@
#############################################################################
UIPortlet.label.portletContent=Descripci\u00f3n del Portlet
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=Ver
UIPortlet.lable.information=Hecho
UIPortlet.deletePortlet=\u00bfEst\u00e1s seguro de que deseas borrar este Portlet?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -754,6 +754,7 @@
#############################################################################
UIPortlet.label.portletContent=Description de portlet
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=Visualiser
UIPortlet.lable.information=Terminé
UIPortlet.deletePortlet=Confirmez-vous la suppression de cette portlet ?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_it.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -770,6 +770,7 @@
#############################################################################
UIPortlet.label.portletContent=Descrizione della Portlet
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=Visualizza
UIPortlet.lable.information=Fatto
UIPortlet.deletePortlet=Sicuro di voler eliminare questa portlet?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ja.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -771,6 +771,7 @@
#############################################################################
UIPortlet.label.portlet=\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.title=\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8
UIPortlet.label.description=GateIn \u30dd\u30fc\u30c8\u30ec\u30c3\u30c8
UIPortlet.label.portletContent=\u30dd\u30fc\u30c8\u30ec\u30c3\u30c8\u306e\u8aac\u660e
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ko.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ko.xml 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ko.xml 2010-02-24
10:58:16 UTC (rev 1837)
@@ -1187,6 +1187,7 @@
<UIPortlet>
<label>
<portletContent>포틀릿 설명</portletContent>
+ <protectedContent>Protected Content</protectedContent>
<View>보기</View>
</label>
<lable>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ne.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -771,6 +771,7 @@
#############################################################################
UIPortlet.label.portlet=\u092a\u094b\u0930\u094d\u091f\u094d\u0932\u0947\u091f
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.title=\u092a\u094b\u0930\u094d\u091f\u094d\u0932\u0947\u091f
UIPortlet.label.description=\u0917\u0947\u091f \u0907\u0928
\u092a\u094b\u0930\u094d\u091f\u094d\u0932\u0947\u091f
UIPortlet.label.portletContent=\u092a\u094b\u0930\u094d\u091f\u094d\u0932\u0947\u091f
\u0935\u092f\u093e\u0928
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_nl.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_nl.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_nl.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -771,6 +771,7 @@
#############################################################################
UIPortlet.label.portletContent=Portlet omschrijving
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=Tonen
UIPortlet.lable.information=#{word.done}
UIPortlet.deletePortlet=Weet U zeker dat U deze portlet wilt verwijderen?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_ru.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -759,6 +759,7 @@
#############################################################################
UIPortlet.label.portletContent=Описание портлета
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=Показать
UIPortlet.lable.information=Готово
UIPortlet.deletePortlet=Вы действительно хотите удалить этот портлет?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_uk.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -750,6 +750,7 @@
#############################################################################
UIPortlet.label.portletContent=Опис портлету
+UIPortlet.label.protectedContent=Protected Content
UIPortlet.label.View=Перегляд
UIPortlet.lable.information=Виконано
UIPortlet.deletePortlet=Ви впевнені, що бажаєте видалити цей портлет?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_vi.properties 2010-02-24
10:58:16 UTC (rev 1837)
@@ -753,6 +753,7 @@
#############################################################################
UIPortlet.label.portletContent=Mô tả Portlet
+UIPortlet.label.protectedContent=Nội dung bị hạn chế
UIPortlet.label.View=Xem
UIPortlet.lable.information=Thực hiện
UIPortlet.deletePortlet=Bạn có chắc chắn muốn xóa Portlet này?
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh.xml 2010-02-24
10:58:16 UTC (rev 1837)
@@ -1136,6 +1136,7 @@
<UIPortlet>
<label>
<portletContent>Portlet描述</portletContent>
+ <protectedContent>Protected Content</protectedContent>
<View>查看</View>
</label>
<lable>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_zh_TW.xml 2010-02-24
10:58:16 UTC (rev 1837)
@@ -1287,6 +1287,7 @@
<UIPortlet>
<label>
<portletContent>Portlet描述</portletContent>
+ <protectedContent>Protected Content</protectedContent>
<View>查看</View>
</label>
<lable>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2010-02-24
10:58:16 UTC (rev 1837)
@@ -7,7 +7,8 @@
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
+ boolean hasPermission = uicomponent.hasPermission();
+ if(!uiPortalApp.isEditing() && !hasPermission) return;
int portalMode = uiPortalApp.getModeState();
JavascriptManager jsmanager = rcontext.getJavascriptManager();
@@ -47,12 +48,15 @@
<div class="CenterBackground">
<div class="GardientBackground">
<%
- try {
- String portletName =
uicomponent.getProducedOfferedPortlet().getInfo().getName();
- print
_ctx.getRequestContext().getApplicationResourceBundle().getString("UIPortlet.description."
+ portletName);
- } catch(Exception e){
- print uicomponent.getDisplayName();
- }%>
+ if(hasPermission) {
+ try {
+ String portletName =
uicomponent.getProducedOfferedPortlet().getInfo().getName();
+ print
_ctx.getRequestContext().getApplicationResourceBundle().getString("UIPortlet.description."
+ portletName);
+ } catch(Exception e){
+ print uicomponent.getDisplayName();
+ }
+ } else print "<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";
+ %>
</div>
</div>
</div>
@@ -230,7 +234,12 @@
<div class="MiddleDecoratorCenter">
<div id="<%=portalMode == UIPortalApplication.NORMAL_MODE ?
portletId : "EditMode-"+ portletId%>" style="width: 100%">
<div class="PORTLET-FRAGMENT UIResizableBlock UIApplication"
style="width: 100%; height: $windowHeight;">
- <% if(windowState != WindowState.MINIMIZED) out.println(portletContent)
%>
+ <%
+ if(windowState != WindowState.MINIMIZED) {
+ if(hasPermission) println portletContent;
+ else println _ctx.appRes("UIPortlet.label.protectedContent");
+ }
+ %>
</div>
</div>
</div>
@@ -264,7 +273,10 @@
%>
<div id="<%=portalMode == UIPortalApplication.NORMAL_MODE ? portletId :
"EditMode-"+ portletId%>">
<div class="PORTLET-FRAGMENT" ${cssStyle}>
- <% out.println(portletContent); %>
+ <%
+ if(hasPermission) println portletContent;
+ else println _ctx.appRes("UIPortlet.label.protectedContent");
+ %>
</div>
</div>
<%
@@ -298,9 +310,11 @@
String title = uicomponent.getDisplayTitle();
if(title.length() > 30) title = title.substring(0,27) +
"...";
%>
- <div class="PortletIcon $portletIcon">$title</div>
- <a
href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>"
class="DeletePortletIcon"
title="<%=_ctx.appRes("UIPortlet.tooltip.deletePortlet");%>"></a>
- <a
href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()"
class="EditPortletPropertiesIcon"
title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
+ <div class="PortletIcon $portletIcon"><%=hasPermission
? title : _ctx.appRes("UIPortlet.label.protectedContent")%></div>
+ <%if(hasPermission) {%>
+ <a
href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>"
class="DeletePortletIcon"
title="<%=_ctx.appRes("UIPortlet.tooltip.deletePortlet");%>"></a>
+ <a
href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()"
class="EditPortletPropertiesIcon"
title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
+ <%}%>
</div>
</div>
</div>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2010-02-24
10:58:16 UTC (rev 1837)
@@ -7,7 +7,8 @@
ResourceBundle res = rcontext.getApplicationResourceBundle();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
+ boolean hasPermission = uicomponent.hasPermission();
+ if(!uiPortalApp.isEditing() && !hasPermission) return;
String cssStyle = "";
String uiComponentWidth = uicomponent.getWidth();
@@ -24,7 +25,10 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>
<%=hasPermission?"": "ProtectedContainer"%>"
+ id="UIContainer-${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">
@@ -38,7 +42,11 @@
<div class="VIEW-CONTAINER VIEW-BLOCK">
<%} %>
<div id="$uicomponent.id">
- <div
class="UIRowContainer"><%uicomponent.renderChildren()%></div>
+ <%if(hasPermission) {%>
+ <div class="UIRowContainer">
+ <%uicomponent.renderChildren();%>
+ </div>
+ <%} else out.print("<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>");%>
</div>
</div>
@@ -57,17 +65,16 @@
<div class="MiddleBar">
<div class="FixHeight">
<div class="DragControlArea"
title="<%=_ctx.appRes("UIContainer.title.DragControlArea")%>"
onmousedown="eXo.portal.PortalDragDrop.init.call(this,event);"><span></span></div>
- <div class="ContainerIcon">
- <%
- if(uicomponent.getTitle() != null) {
- println(ExpressionUtil.getExpressionValue(res,
uicomponent.getTitle()));
- } else {
- %>
- <%=_ctx.appRes("UIContainer.title.Container")%>
- <%}%>
- </div>
- <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>
+ <%
+ 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("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>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2010-02-24
10:58:16 UTC (rev 1837)
@@ -6,7 +6,8 @@
ResourceBundle res = rcontext.getApplicationResourceBundle();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
+ 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();
@@ -15,7 +16,10 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<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">
@@ -33,7 +37,8 @@
<%} else {%>
<div class="VIEW-CONTAINER VIEW-BLOCK">
<%} %>
- <div id="$uicomponent.id">
+ <div id="$uicomponent.id">
+ <%if(hasPermission) {%>
<table class="UITableColumnContainer" style="table-layout: fixed;
margin: 0px auto; $style">
<tr class="TRContainer">
<% for(uiChild in uicomponent.getChildren()) {%>
@@ -41,6 +46,7 @@
<% } %>
</tr>
</table>
+ <%} else {print "<div
class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";}%>
</div>
</div>
<%/*Debug On IE -----For DND */%>
@@ -60,18 +66,16 @@
<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>
- <div class="ContainerIcon DefaultContainer16x16Icon">
- <%
- if(uicomponent.getTitle() != null) {
- println(ExpressionUtil.getExpressionValue(res, uicomponent.getTitle()));
- } else {
- %>
- <%=_ctx.appRes("UIContainer.title.Container")%>
- <%}%>
- </div>
-
- <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")%>"></a>
+ <%
+ 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>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl 2010-02-24
10:30:50 UTC (rev 1836)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl 2010-02-24
10:58:16 UTC (rev 1837)
@@ -5,13 +5,17 @@
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
+ boolean hasPermission = uicomponent.hasPermission();
+ if(!uiPortalApp.isEditing() && !hasPermission) return;
JavascriptManager jsmanager = rcontext.getJavascriptManager();
jsmanager.importJavascript('eXo.portal.PortalDragDrop');
%>
-<div class="UIContainer UIToolbarContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer UIToolbarContainer
<%=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">
@@ -29,7 +33,8 @@
<%} else {%>
<div class="VIEW-CONTAINER ToolbarContainer VIEW-BLOCK">
<%} %>
- <div id="$uicomponent.id">
+ <div id="$uicomponent.id">
+ <%if(hasPermission) {%>
<div class="UITableColumnContainer" style="margin: 0px auto;
$style">
<div class="TRContainer" style="zoom: 100%;">
<% for(uiChild in uicomponent.getChildren()) {%>
@@ -38,6 +43,7 @@
<div class="ClearLeft" style="width: 0px; height:
0px;"><span></span></div>
</div>
</div>
+ <%}%>
</div>
</div>
<%/*Debug On IE -----For DND */%>
@@ -57,18 +63,16 @@
<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>
- <div class="ContainerIcon DefaultContainer16x16Icon">
- <%
- if(uicomponent.getTitle() != null) {
- println(uicomponent.getTitle());
- } else {
- %>
- <%=_ctx.appRes("UIContainer.title.Container")%>
- <%}%>
- </div>
-
- <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")%>"></a>
+ <%
+ 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>
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl 2010-02-24
10:30:50 UTC (rev 1836)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UITree.gtmpl 2010-02-24
10:58:16 UTC (rev 1837)
@@ -12,7 +12,6 @@
rcontext.getJavascriptManager().importJavascript('eXo.webui.UIRightClickPopupMenu');
rcontext.getJavascriptManager().addJavascript("eXo.webui.UIRightClickPopupMenu.disableContextMenu('"+id+"');");
- rcontext.getJavascriptManager().addOnLoadJavascript('eXo.portal.UIPortalControl.fixHeight');
uicomponent.renderUIComponent(uiPopupMenu);
}
%>