gatein SVN: r7928 - portal/trunk/gadgets/server/src/main/webapp/containers/default.
by do-not-reply@jboss.org
Author: kien_nguyen
Date: 2011-11-02 07:40:58 -0400 (Wed, 02 Nov 2011)
New Revision: 7928
Modified:
portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js
Log:
GTNPORTAL-2246 Gadget render error in HTTPS mode
Modified: portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js
===================================================================
--- portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js 2011-11-02 09:35:40 UTC (rev 7927)
+++ portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js 2011-11-02 11:40:58 UTC (rev 7928)
@@ -111,7 +111,7 @@
},
// Default Js Uri config: also must be overridden.
-"gadgets.uri.js.host" : "http://%host%/",
+"gadgets.uri.js.host" : "//%host%/",
"gadgets.uri.js.path" : "/eXoGadgetServer/gadgets/js",
// Default concat Uri config; used for testing.
13 years, 1 month
gatein SVN: r7927 - in epp/portal/branches/EPP_5_2_Branch: examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr and 3 other directories.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-02 05:35:40 -0400 (Wed, 02 Nov 2011)
New Revision: 7927
Modified:
epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration-jboss.properties
epp/portal/branches/EPP_5_2_Branch/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml
epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/repository-configuration.xml
Log:
JBEPP-1332: Externalize some JCR Workspace properties
Modified: epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration-jboss.properties
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration-jboss.properties 2011-11-02 08:21:14 UTC (rev 7926)
+++ epp/portal/branches/EPP_5_2_Branch/component/common/src/main/java/conf/configuration-jboss.properties 2011-11-02 09:35:40 UTC (rev 7927)
@@ -37,6 +37,8 @@
gatein.jcr.index.changefilterclass=org.exoplatform.services.jcr.impl.core.query.DefaultChangesFilter
gatein.jcr.index.cache.config=war:/conf/jcr/jbosscache/cluster/indexer-config.xml
gatein.jcr.jgroups.config=classpath:/jgroups/gatein-${gatein.default.jgroups.stack:udp}.xml
+gatein.jcr.workspace.default=portal-system
+gatein.jcr.workspace.system=system
# IDM
gatein.idm.datasource.name=java:gatein-idm
Modified: epp/portal/branches/EPP_5_2_Branch/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml 2011-11-02 08:21:14 UTC (rev 7926)
+++ epp/portal/branches/EPP_5_2_Branch/examples/extension/war/src/main/webapp/WEB-INF/conf/sample-ext/jcr/repository-configuration.xml 2011-11-02 09:35:40 UTC (rev 7927)
@@ -21,9 +21,9 @@
<repository-service default-repository="repository">
<repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
- <access-control>optional</access-control>
+ <repository name="repository" system-workspace="${gatein.jcr.workspace.system}" default-workspace="${gatein.jcr.workspace.default}">
+ <security-domain>${portal.container.realm}</security-domain>
+ <access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
<workspaces>
<workspace name="sample-ws">
Modified: epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml 2011-11-02 08:21:14 UTC (rev 7926)
+++ epp/portal/branches/EPP_5_2_Branch/examples/portal/war/src/main/webapp/WEB-INF/conf/sample-portal/jcr/repository-configuration.xml 2011-11-02 09:35:40 UTC (rev 7927)
@@ -21,8 +21,8 @@
<repository-service default-repository="repository">
<repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
+ <repository name="repository" system-workspace="${gatein.jcr.workspace.system}" default-workspace="${gatein.jcr.workspace.default}">
+ <security-domain>${portal.container.realm}</security-domain>
<access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
<workspaces>
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2011-11-02 08:21:14 UTC (rev 7926)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2011-11-02 09:35:40 UTC (rev 7927)
@@ -21,8 +21,8 @@
<repository-service default-repository="repository">
<repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
+ <repository name="repository" system-workspace="${gatein.jcr.workspace.system}" default-workspace="${gatein.jcr.workspace.default}">
+ <security-domain>${portal.container.realm}</security-domain>
<access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
Modified: epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/repository-configuration.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/repository-configuration.xml 2011-11-02 08:21:14 UTC (rev 7926)
+++ epp/portal/branches/EPP_5_2_Branch/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/repository-configuration.xml 2011-11-02 09:35:40 UTC (rev 7927)
@@ -23,8 +23,8 @@
<repository-service default-repository="repository">
<repositories>
- <repository name="repository" system-workspace="system" default-workspace="portal-system">
- <security-domain>gatein-domain</security-domain>
+ <repository name="repository" system-workspace="${gatein.jcr.workspace.system}" default-workspace="${gatein.jcr.workspace.default}">
+ <security-domain>${portal.container.realm}</security-domain>
<access-control>optional</access-control>
<authentication-policy>org.exoplatform.services.jcr.impl.core.access.JAASAuthenticator</authentication-policy>
<workspaces>
13 years, 1 month
gatein SVN: r7926 - epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-02 04:21:14 -0400 (Wed, 02 Nov 2011)
New Revision: 7926
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java
Log:
Forgot to fix the test
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java 2011-11-02 07:23:20 UTC (rev 7925)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/TestXSDCorruption.java 2011-11-02 08:21:14 UTC (rev 7926)
@@ -59,6 +59,6 @@
{
assertHash("c68ea6831c3d24a242f63abd2db261a6", "gatein_resources_1_0.xsd");
assertHash("c55b7e0dc8ae23e2d34430b38260cd96", "gatein_resources_1_1.xsd");
- assertHash("378178d66c1efacf87619c3c60a4cbf6", "gatein_resources_1_2.xsd");
+ assertHash("6d5566a86feb32f30fb9c7551c026042", "gatein_resources_1_2.xsd");
}
-}
\ No newline at end of file
+}
13 years, 1 month
gatein SVN: r7925 - epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-02 03:23:20 -0400 (Wed, 02 Nov 2011)
New Revision: 7925
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd
Log:
Whitespaces fix
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd 2011-11-02 07:13:00 UTC (rev 7924)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/gatein_resources_1_2.xsd 2011-11-02 07:23:20 UTC (rev 7925)
@@ -45,8 +45,8 @@
<xs:element name="skin-name" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="skin-module" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="css-path" type="xs:string" minOccurs="1" maxOccurs="1"/>
- <xs:element name="css-priority" type="xs:string" minOccurs="0" maxOccurs="1"/>
- <xs:element name="overwrite" type="xs:integer" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="css-priority" type="xs:integer" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="overwrite" type="xs:string" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
13 years, 1 month
gatein SVN: r7924 - in portal/trunk: web/eXoResources/src/main/webapp/javascript/eXo/core and 6 other directories.
by do-not-reply@jboss.org
Author: haint
Date: 2011-11-02 03:13:00 -0400 (Wed, 02 Nov 2011)
New Revision: 7924
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageManagementPortlet.java
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/UIPortalApplicationSkin.css
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIVirtualList.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
Log:
GTNPORTAL-2248 Page Management is too short
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageManagementPortlet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageManagementPortlet.java 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageManagementPortlet.java 2011-11-02 07:13:00 UTC (rev 7924)
@@ -19,10 +19,11 @@
package org.exoplatform.navigation.webui.component;
+import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.portal.webui.page.UIPageBrowser;
-import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.UIVirtualList;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
/**
@@ -36,8 +37,13 @@
@Serialized
public class UIPageManagementPortlet extends UIPortletApplication
{
+ public static String PAGE_LIST_HEIGHT = "pageListHeight";
+
public UIPageManagementPortlet() throws Exception
{
- addChild(UIPageBrowser.class, null, null).setShowAddNewPage(true);
+ UIPageBrowser pageBrowser = addChild(UIPageBrowser.class, null, null);
+ pageBrowser.setShowAddNewPage(true);
+ UIVirtualList virtualList = pageBrowser.getChild(UIVirtualList.class);
+ virtualList.setAutoAdjustHeight(true);
}
}
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 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/core/Browser.js 2011-11-02 07:13:00 UTC (rev 7924)
@@ -539,6 +539,32 @@
if(document.getElementById("UIPageDesktop")) return true ;
return false ;
}
+
+/**
+ * Return the height of free space in the page if it is available.
+ * Otherwise, returns a negative which is equal to the height of content not visible on the screen.
+ */
+Browser.prototype.getHeightOfFreeSpace = function() {
+ var elements = document.body.children;
+ var height = 0;
+ var ln = elements.length ;
+ for(var k = 0; k < ln; k++) {
+ height += elements[k].offsetHeight ;
+ }
+ return (this.getBrowserHeight() - height);
+}
+
+/**
+ * Adjust height of the element to fill up free space if any
+ */
+Browser.prototype.fillUpFreeSpace = function(elemt) {
+ var height = eXo.core.Browser.getHeightOfFreeSpace();
+ if (height > 0)
+ {
+ height += elemt.offsetHeight;
+ elemt.style.height = height + "px";
+ }
+}
/************************************************************************************/
eXo.core.Browser = new Browser() ;
-eXo.core.Mouse = new MouseObject() ;
\ No newline at end of file
+eXo.core.Mouse = new MouseObject() ;
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/webui/UIVirtualList.js 2011-11-02 07:13:00 UTC (rev 7924)
@@ -19,20 +19,31 @@
function UIVirtualList() {}
-UIVirtualList.prototype.init = function(componentId) {
+UIVirtualList.prototype.init = function(componentId, hasNext, autoAdjustHeight) {
var uiVirtualList = document.getElementById(componentId);
if (uiVirtualList == null) return;
- uiVirtualList.style.height = "300px";
+ var virtualHeight = 300;
+
//If parent of virtualList have style.display = none --> can't get virtualList's height
var tmp = uiVirtualList;
- if (uiVirtualList.offsetHeight == 0) {
+ if (tmp.offsetHeight == 0) {
tmp = uiVirtualList.cloneNode(true);
tmp.style.visibility = "hidden";
+ tmp.style.display = "block";
document.body.appendChild(tmp);
}
- var virtualHeight = tmp.offsetHeight;
+ if (eXo.core.DOMUtil.getStyle(tmp, "height")) {
+ virtualHeight = tmp.offsetHeight;
+ }
+ uiVirtualList.style.height = virtualHeight + "px";
+
+ if (autoAdjustHeight)
+ {
+ eXo.core.Browser.fillUpFreeSpace(uiVirtualList);
+ }
+
var children = eXo.core.DOMUtil.getChildrenByTagName(tmp,"div");
var childrenHeight = 0;
for (var i=0; i<children.length;i++) {
@@ -43,12 +54,23 @@
document.body.removeChild(tmp);
}
- if (!uiVirtualList.isFinished && childrenHeight <= virtualHeight && childrenHeight != 0) {
- uiVirtualList.onscroll();
- } else {
- uiVirtualList.isInitiated = true;
- uiVirtualList.scrollTop = 0;
+ if (childrenHeight <= uiVirtualList.offsetHeight)
+ {
+ if (hasNext && childrenHeight != 0)
+ {
+ uiVirtualList.onscroll();
+ }
+ else
+ {
+ uiVirtualList.isFinished = true;
+ if (autoAdjustHeight)
+ {
+ uiVirtualList.style.height = "auto";
+ }
+ }
}
+ uiVirtualList.isInitiated = true;
+ uiVirtualList.scrollTop = 0;
}
UIVirtualList.prototype.getFeedBox = function(componentId) {
@@ -61,7 +83,7 @@
return feedBox;
}
-UIVirtualList.prototype.scrollMove = function(uiVirtualList, url) {
+UIVirtualList.prototype.onScroll = function(uiVirtualList, url) {
if (uiVirtualList.isFinished || uiVirtualList.isLocked) return;
var DOMUtil = eXo.core.DOMUtil;
var componentHeight = uiVirtualList.offsetHeight;
@@ -78,11 +100,16 @@
}
}
-UIVirtualList.prototype.updateList = function(componentId) {
+UIVirtualList.prototype.updateList = function(componentId, hasNext) {
var DOMUtil = eXo.core.DOMUtil;
-var uiVirtualList = document.getElementById(componentId);
+ var uiVirtualList = document.getElementById(componentId);
if (uiVirtualList == null) return;
+ if (!hasNext)
+ {
+ uiVirtualList.isFinished = true;
+ }
+
var feedBox = this.getFeedBox(uiVirtualList.id);
var loadedContent = uiVirtualList.storeHTML;
@@ -101,10 +128,4 @@
}
}
-UIVirtualList.prototype.loadFinished = function(componentId) {
- var uiVirtualList = document.getElementById(componentId);
- if (uiVirtualList == null) return;
- uiVirtualList.isFinished = true;
-}
-
-eXo.webui.UIVirtualList = new UIVirtualList();
\ No newline at end of file
+eXo.webui.UIVirtualList = new UIVirtualList();
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/UIPortalApplicationSkin.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/UIPortalApplicationSkin.css 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/UIPortalApplicationSkin.css 2011-11-02 07:13:00 UTC (rev 7924)
@@ -161,4 +161,8 @@
.ClearBoth {
clear: both;
-}
\ No newline at end of file
+}
+
+.UIVirtualList {
+ height: 300px;
+}
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 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2011-11-02 07:13:00 UTC (rev 7924)
@@ -191,20 +191,29 @@
<%
} else {
if(windowState != WindowState.MINIMIZED) {
- String windowWidth = uicomponent.getWidth();
- if(windowWidth!= null && !windowWidth.contains("%") && !windowWidth.contains("px")) windowWidth += "px";
- String windowHeight = uicomponent.getHeight();
- if(windowHeight != null && !windowHeight.contains("%") && !windowHeight.contains("px")) windowHeight += "px";
- String cssStyle = "style=\"";
- cssStyle += "width: "+ windowWidth +";";
- cssStyle += "height: "+ windowHeight +";";
- cssStyle += "\"";
-%>
- <div id="<%=portalMode == UIPortalApplication.NORMAL_MODE ? portletId : "EditMode-"+ portletId%>">
- <div class="PORTLET-FRAGMENT" ${cssStyle}>
- <%
- if(hasPermission) println portletContent;
- else println "<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";
+ String cssStyle = "";
+ String windowWidth = uicomponent.getWidth();
+ if(windowWidth!= null && !windowWidth.contains("%") && !windowWidth.contains("px"))
+ {
+ cssStyle += "width: "+ windowWidth +"px;";
+ }
+ String windowHeight = uicomponent.getHeight();
+ if(windowHeight != null && !windowHeight.contains("%") && !windowHeight.contains("px"))
+ {
+ cssStyle += "height: "+ windowHeight +"px;";
+ }
+ %>
+ <div id="<%=portalMode == UIPortalApplication.NORMAL_MODE ? portletId : "EditMode-"+ portletId%>">
+ <div class="PORTLET-FRAGMENT" style="${cssStyle}">
+ <%
+ if(hasPermission)
+ {
+ println portletContent;
+ }
+ else
+ {
+ println "<div class='ProtectedContent'>"+_ctx.appRes("UIPortlet.label.protectedContent")+"</div>";
+ }
%>
</div>
</div>
@@ -243,4 +252,4 @@
</div>
</div>
</div>
-<%}%>
\ No newline at end of file
+<%}%>
Modified: portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIVirtualList.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIVirtualList.gtmpl 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/web/portal/src/main/webapp/groovy/webui/core/UIVirtualList.gtmpl 2011-11-02 07:13:00 UTC (rev 7924)
@@ -3,6 +3,7 @@
import org.exoplatform.webui.bean.UIDataFeed;
boolean hasNext = uicomponent.getDataFeed().hasNext();
+ boolean isAutoAdjustHeight = uicomponent.isAutoAdjustHeight();
def rcontext = _ctx.getRequestContext();
rcontext.getJavascriptManager().importJavascript('eXo.core.DOMUtil');
@@ -10,17 +11,15 @@
rcontext.getJavascriptManager().importJavascript('eXo.webui.UIVirtualList');
String url = uicomponent.url("LoadNext") + "&ajaxRequest=true";
+ String css = "";
+ if (uicomponent.getHeight() > 0) {
+ css = "height: " + uicomponent.getHeight() + "px";
+ }
%>
-<div id="$uicomponent.id" style="overflow:auto;"
- onscroll="eXo.webui.UIVirtualList.scrollMove(this,'$url');">
- <div>
- <% uicomponent.renderChildren();%>
- </div>
+<div id="$uicomponent.id" class="UIVirtualList" style="overflow:auto; $css"
+ onscroll="eXo.webui.UIVirtualList.onScroll(this,'$url');">
+ <% uicomponent.renderChildren();%>
<%
- if (!hasNext) {
- rcontext.getJavascriptManager().addJavascript("eXo.webui.UIVirtualList.loadFinished('$uicomponent.id');");
- }
- rcontext.getJavascriptManager().addJavascript("eXo.webui.UIVirtualList.init('$uicomponent.id');");
-
+ rcontext.getJavascriptManager().addJavascript("eXo.webui.UIVirtualList.init('$uicomponent.id', $hasNext, $isAutoAdjustHeight);");
%>
-</div>
\ No newline at end of file
+</div>
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIVirtualList.java 2011-11-02 07:13:00 UTC (rev 7924)
@@ -35,6 +35,10 @@
{
private int pageSize = 1;
+
+ private int height;
+
+ private boolean autoAdjustHeight;
public int getPageSize()
{
@@ -45,6 +49,26 @@
{
this.pageSize = pageSize;
}
+
+ public int getHeight()
+ {
+ return height;
+ }
+
+ public void setHeight(int height)
+ {
+ this.height = height;
+ }
+
+ public boolean isAutoAdjustHeight()
+ {
+ return autoAdjustHeight;
+ }
+
+ public void setAutoAdjustHeight(boolean auto)
+ {
+ this.autoAdjustHeight = auto;
+ }
public String event(String name, String beanId) throws Exception
{
@@ -89,13 +113,17 @@
return;
}
- if (!dataFeed.hasNext())
+ if (dataFeed.hasNext())
{
rContext.getJavascriptManager().addJavascript(
- "eXo.webui.UIVirtualList.loadFinished('" + virtualList.getId() + "');");
+ "eXo.webui.UIVirtualList.updateList('" + virtualList.getId() + "', true);");
}
- rContext.getJavascriptManager().addJavascript(
- "eXo.webui.UIVirtualList.updateList('" + virtualList.getId() + "');");
+ else
+ {
+ rContext.getJavascriptManager().addJavascript(
+ "eXo.webui.UIVirtualList.updateList('" + virtualList.getId() + "', false);");
+ }
+
rContext.addUIComponentToUpdateByAjax((UIComponent)dataFeed);
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-11-02 04:56:04 UTC (rev 7923)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBrowser.java 2011-11-02 07:13:00 UTC (rev 7924)
@@ -23,8 +23,6 @@
import java.util.List;
import java.util.ResourceBundle;
-import javassist.bytecode.analysis.Type;
-
import javax.portlet.ActionResponse;
import javax.xml.namespace.QName;
@@ -71,18 +69,10 @@
import org.exoplatform.webui.event.Event.Phase;
import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormInputItemSelector;
import org.exoplatform.webui.form.UIFormInputSet;
import org.exoplatform.webui.form.UIFormSelectBox;
import org.exoplatform.webui.form.UIFormStringInput;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ResourceBundle;
-
-import javax.portlet.ActionResponse;
-import javax.xml.namespace.QName;
-
@ComponentConfigs({
@ComponentConfig(template = "system:/groovy/portal/webui/page/UIPageBrowser.gtmpl", events = {
@EventConfig(listeners = UIPageBrowser.DeleteActionListener.class, confirm = "UIPageBrowse.deletePage"),
@@ -230,7 +220,7 @@
{
this.showAddNewPage = showAddNewPage;
}
-
+
public void processDecode(WebuiRequestContext context) throws Exception
{
super.processDecode(context);
13 years, 1 month
gatein SVN: r7923 - in portal/trunk: portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component and 11 other directories.
by do-not-reply@jboss.org
Author: trong.tran
Date: 2011-11-02 00:56:04 -0400 (Wed, 02 Nov 2011)
New Revision: 7923
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormHiddenInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBoxWithGroups.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/input/UICheckBoxInput.java
portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/account/UIAccountProfiles.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIChangePassword.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIWizardPageSetInfo.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
Log:
GTNPORTAL-2245 Set of improvements in Form input components
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -73,10 +73,10 @@
application_ = app;
if (application_ == null)
{
- getUIStringInput("applicationName").setEditable(true);
+ getUIStringInput("applicationName").setReadOnly(false);
return;
}
- getUIStringInput("applicationName").setEditable(false);
+ getUIStringInput("applicationName").setReadOnly(true);
invokeGetBindingBean(app);
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UICategoryForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -99,11 +99,11 @@
if (category == null)
{
category_ = null;
- uiSetting.getUIStringInput(FIELD_NAME).setEditable(true);
+ uiSetting.getUIStringInput(FIELD_NAME).setReadOnly(false);
return;
}
category_ = category;
- uiSetting.getUIStringInput(FIELD_NAME).setEditable(false).setValue(category_.getName());
+ uiSetting.getUIStringInput(FIELD_NAME).setReadOnly(true).setValue(category_.getName());
uiSetting.getUIStringInput(FIELD_DISPLAY_NAME).setValue(category_.getDisplayName());
uiSetting.getUIFormTextAreaInput(FIELD_DESCRIPTION).setValue(category_.getDescription());
List<String> accessPermissions = category_.getAccessPermissions();
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -122,7 +122,7 @@
UIFormStringInput uiInputName = getUIStringInput(FIELD_NAME);
uiInputSource.setValue(uiInputSource.getValue());
if(this.isEdit()) {
- uiInputName.setEditable(false);
+ uiInputName.setReadOnly(true);
}
super.processRender(context);
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UIPageNodeForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -136,7 +136,7 @@
initLanguageSelectBox(uiFormLanguagesSelectBox);
uiFormLanguagesSelectBox.setOnChange(LANGUAGES_ONCHANGE);
- uiSettingSet.addUIFormInput(new UIFormStringInput("URI", "URI", null).setEditable(false))
+ uiSettingSet.addUIFormInput(new UIFormStringInput("URI", "URI", null).setReadOnly(true))
.addUIFormInput(new UIFormStringInput("name", "name", null).addValidator(MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class))
.addUIFormInput(uiSwitchLabelMode)
.addUIFormInput(new UIFormStringInput(LABEL, LABEL, null).addValidator(StringLengthValidator.class, 3, 120))
@@ -171,13 +171,13 @@
cachedLabels = new HashMap<String, Described.State>();
if (pageNode == null)
{
- getUIStringInput("name").setEditable(UIFormStringInput.ENABLE);
+ getUIStringInput("name").setReadOnly(false);
getChild(UIFormInputIconSelector.class).setSelectedIcon("Default");
setShowPublicationDate(false);
switchLabelMode(true);
return;
}
- getUIStringInput("name").setEditable(UIFormStringInput.DISABLE);
+ getUIStringInput("name").setReadOnly(true);
invokeGetBindingBean(pageNode_);
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIAccountEditInputSet.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -61,7 +61,7 @@
public UIAccountEditInputSet(String name) throws Exception
{
super(name);
- addUIFormInput(new UIFormStringInput(USERNAME, "userName", null).setEditable(false).addValidator(
+ addUIFormInput(new UIFormStringInput(USERNAME, "userName", null).setReadOnly(true).addValidator(
MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30).addValidator(
ResourceValidator.class).addValidator(ExpressionValidator.class, Utils.USER_NAME_VALIDATOR_REGEX,
"ResourceValidator.msg.Invalid-char"));
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupEditMembershipForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -68,7 +68,7 @@
public UIGroupEditMembershipForm() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).setEditable(false));
+ addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).setReadOnly(true));
addUIFormInput(new UIFormSelectBox(MEMBER_SHIP, MEMBER_SHIP, listOption).setSize(1));
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIGroupForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -74,13 +74,13 @@
if (group != null)
{
this.groupId = group.getId();
- getUIStringInput(GROUP_NAME).setEditable(UIFormStringInput.DISABLE);
+ getUIStringInput(GROUP_NAME).setReadOnly(true);
invokeGetBindingBean(group);
}
else
{
this.groupId = null;
- getUIStringInput(GROUP_NAME).setEditable(UIFormStringInput.ENABLE);
+ getUIStringInput(GROUP_NAME).setReadOnly(false);
reset();
}
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/organization/webui/component/UIMembershipTypeForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -51,9 +51,9 @@
public UIMembershipTypeForm() throws Exception
{
- addUIFormInput(new UIFormStringInput(MEMBERSHIP_TYPE_NAME, MEMBERSHIP_TYPE_NAME, null).setEditable(
- UIFormStringInput.ENABLE).addValidator(MandatoryValidator.class).addValidator(StringLengthValidator.class, 3,
- 30).addValidator(NameValidator.class).addValidator(SpecialCharacterValidator.class));
+ addUIFormInput(new UIFormStringInput(MEMBERSHIP_TYPE_NAME, MEMBERSHIP_TYPE_NAME, null).setReadOnly(false)
+ .addValidator(MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30)
+ .addValidator(NameValidator.class).addValidator(SpecialCharacterValidator.class));
addUIFormInput(new UIFormTextAreaInput(DESCRIPTION, DESCRIPTION, null));
}
@@ -63,13 +63,13 @@
if (membershipType == null)
{
membershipTypeName = null;
- getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.ENABLE);
+ getUIStringInput(MEMBERSHIP_TYPE_NAME).setReadOnly(false);
return;
}
else
{
membershipTypeName = membershipType.getName();
- getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.DISABLE);
+ getUIStringInput(MEMBERSHIP_TYPE_NAME).setReadOnly(true);
}
invokeGetBindingBean(membershipType);
}
@@ -121,7 +121,7 @@
}
uiMembershipManagement.getChild(UIListMembershipType.class).loadData();
- uiForm.getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.ENABLE);
+ uiForm.getUIStringInput(MEMBERSHIP_TYPE_NAME).setReadOnly(false);
uiForm.setMembershipType(null);
uiForm.reset();
}
@@ -132,7 +132,7 @@
public void execute(Event<UIMembershipTypeForm> event) throws Exception
{
UIMembershipTypeForm uiForm = event.getSource();
- uiForm.getUIStringInput(MEMBERSHIP_TYPE_NAME).setEditable(UIFormStringInput.ENABLE);
+ uiForm.getUIStringInput(MEMBERSHIP_TYPE_NAME).setReadOnly(false);
uiForm.setMembershipType(null);
uiForm.reset();
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/bean/ReflectionDataMapping.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -124,7 +124,7 @@
if (uiFormInput instanceof UIFormInputBase)
{
UIFormInputBase uiStringBase = (UIFormInputBase)uiFormInput;
- if (!uiStringBase.isEditable())
+ if (uiStringBase.isReadOnly())
{
return;
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormCheckBoxInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -118,7 +118,7 @@
@SuppressWarnings("unused")
public void decode(Object input, WebuiRequestContext context) throws Exception
{
- if (!isEnable())
+ if (isDisabled())
return;
if (input != null) {
if(input.equals("true"))
@@ -149,8 +149,11 @@
}
if (checked)
w.write(" checked ");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled ");
+
+ renderHTMLAttributes(w);
+
w.write(" class='checkbox'/>");
if (this.isMandatory())
w.write(" *");
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormDateTimeInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -242,14 +242,13 @@
w.write(value);
w.write('\"');
w.write(" onclick='event.cancelBubble = true' onkeydown='eXo.webui.UICalendar.onTabOut(event)'");
- if(!isEditable())
+ if(isReadOnly())
{
w.write(" readonly ");
}
- if(hasHTMLAttribute())
- {
- renderHTMLAttribute(w);
- }
+
+ renderHTMLAttributes(w);
+
w.write("/>");
}
}
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormHiddenInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormHiddenInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormHiddenInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -56,21 +56,24 @@
public void processRender(WebuiRequestContext context) throws Exception
{
- Writer print = context.getWriter();
- print.write("<input name='");
- print.write(getName());
- print.write("' type='hidden'");
- print.write(" id='");
- print.write(getId());
- print.write("'");
+ Writer w = context.getWriter();
+ w.write("<input name='");
+ w.write(getName());
+ w.write("' type='hidden'");
+ w.write(" id='");
+ w.write(getId());
+ w.write("'");
String value = getValue();
if (value != null && value.length() > 0)
{
- print.write(" value='");
+ w.write(" value='");
value = HTMLEntityEncoder.getInstance().encodeHTMLAttribute(value);
- print.write(value);
- print.write("'");
+ w.write(value);
+ w.write("'");
}
- print.write(" />");
+
+ renderHTMLAttributes(w);
+
+ w.write(" />");
}
}
\ No newline at end of file
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputBase.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -48,7 +48,10 @@
@Serialized
abstract public class UIFormInputBase<T> extends UIContainer implements UIFormInput<T>
{
-
+ /**
+ * @deprecated According to deprecation of the {@link #setEditable(boolean)} and {@link #setEnable(boolean)} methods
+ */
+ @Deprecated
final static public boolean ENABLE = true, DISABLE = false;
/**
@@ -87,9 +90,17 @@
protected Class<T> typeValue_;
/**
+ * @deprecated According to the deprecation of the {@link #setEnable(boolean)} method
+ *
* Whether this field is enabled
*/
+ @Deprecated
protected boolean enable_ = true;
+
+ /**
+ * Whether this field is disabled.
+ */
+ protected boolean disabled = false;
/**
* Whether this field is in read only mode
@@ -99,7 +110,7 @@
/**
* A map of HTML attribute
*/
- private Map<String, String> attribute;
+ private Map<String, String> attributes;
public UIFormInputBase(String name, String bindingField, Class<T> typeValue)
{
@@ -164,31 +175,101 @@
value_ = defaultValue_;
}
+ /**
+ * @deprecated Use {@link #isDisabled()} instead
+ * @return
+ */
+ @Deprecated
public boolean isEnable()
{
- return enable_;
+ return !isDisabled();
}
+ /**
+ * @deprecated Use {@link #setDisabled(boolean)} instead
+ *
+ * @param enable
+ * @return
+ */
+ @Deprecated
public UIFormInputBase<T> setEnable(boolean enable)
{
- enable_ = enable;
+ return setDisabled(!enable);
+ }
+
+ /**
+ * Return <code>true</code> if this input field is disabled.
+ * Otherwise, return <code>false</code>.
+ *
+ * @return True if this input field is disabled. Otherwise, return false.
+ */
+ public boolean isDisabled()
+ {
+ return disabled;
+ }
+
+ /**
+ * Specifies that this input field should be disabled OR NOT.
+ *
+ * @param disabled
+ * @return
+ */
+ public UIFormInputBase<T> setDisabled(boolean disabled)
+ {
+ this.disabled = disabled;
+ enable_ = !disabled; // for compatibility
return this;
}
+ /**
+ * @deprecated Use {@link #isReadOnly()} instead
+ *
+ * @return True if the input is read only. Otherwise, return false.
+ */
+ @Deprecated
public boolean isEditable()
{
- return !readonly_;
+ return !isReadOnly();
}
+ /**
+ * @deprecated Use {@link #setReadOnly(boolean)} instead
+ *
+ * @param editable
+ * @return
+ */
+ @Deprecated
public UIFormInputBase<T> setEditable(boolean editable)
{
- readonly_ = !editable;
+ return setReadOnly(!editable);
+ }
+
+ /**
+ * Return <code>true</code> if this input field is read only.
+ * Otherwise, return <code>false</code>.
+ *
+ * @return True if the input is read only. Otherwise, return false.
+ */
+ public boolean isReadOnly()
+ {
+ return readonly_;
+ }
+
+ /**
+ * Specifies that this input field should be read-only OR NOT.
+ *
+ * @param readonly
+ * @return
+ */
+ public UIFormInputBase<T> setReadOnly(boolean readonly)
+ {
+ readonly_ = readonly;
return this;
}
public boolean isValid()
{
- return (isRendered() && isEditable() && isEnable());
+ return (isRendered() && !isReadOnly() && !isDisabled());
}
public <E extends Validator> UIFormInputBase<T> addValidator(Class<E> clazz, Object... params) throws Exception
@@ -250,42 +331,33 @@
public String getHTMLAttribute(String name)
{
- if (attribute != null)
+ if (attributes != null)
{
- return attribute.get(name);
+ return attributes.get(name);
}
return null;
}
public void setHTMLAttribute(String name, String value)
{
- if (attribute == null)
+ if (attributes == null)
{
- attribute = new HashMap<String, String>();
+ attributes = new HashMap<String, String>();
}
- attribute.put(name, value);
+ attributes.put(name, value);
}
- public boolean hasHTMLAttribute()
+ protected void renderHTMLAttributes(Writer w) throws IOException
{
- if(attribute == null)
+ if (attributes != null)
{
- return false;
- }
- return attribute.size() > 0 ;
- }
-
- protected void renderHTMLAttribute(Writer w) throws IOException
- {
- if (attribute != null)
- {
- w.write(" ");
- for (String name : attribute.keySet())
+ w.append(" ");
+ for (String name : attributes.keySet())
{
- String value = HTMLEntityEncoder.getInstance().encodeHTMLAttribute(attribute.get(name));
- w.write(name + "=\"" + value + "\"");
+ String value = HTMLEntityEncoder.getInstance().encodeHTMLAttribute(attributes.get(name));
+ w.append(name + "=\"" + value + "\"");
}
- w.write(" ");
+ w.append(" ");
}
}
}
\ No newline at end of file
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormInputSet.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -27,6 +27,7 @@
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.input.UICheckBoxInput;
import java.io.Writer;
import java.util.MissingResourceException;
@@ -105,6 +106,11 @@
return (UIFormCheckBoxInput)findComponentById(name);
}
+ public UICheckBoxInput getUICheckBoxInput(String name)
+ {
+ return (UICheckBoxInput)findComponentById(name);
+ }
+
public UIFormSelectBox getUIFormSelectBox(String name)
{
return (UIFormSelectBox)findComponentById(name);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormMultiValueInputSet.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -220,8 +220,8 @@
UIFormInputBase uiInput = getChild(i);
writer.append("<div class=\"MultiValueContainer\">");
- uiInput.setEditable(!readonly_);
- uiInput.setEnable(enable_);
+ uiInput.setReadOnly(readonly_);
+ uiInput.setDisabled(!enable_);
uiInput.processRender(context);
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormRadioBoxInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -100,7 +100,7 @@
@SuppressWarnings("unused")
public void decode(Object input, WebuiRequestContext context) throws Exception
{
- if (!enable_)
+ if (isDisabled())
return;
if (input != null)
value_ = (String)input;
@@ -132,7 +132,7 @@
w.write("<input class='radio' type='radio'");
if (readonly_)
w.write(" readonly ");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled ");
w.write(checked);
w.write(" name='");
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBox.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -170,8 +170,7 @@
@SuppressWarnings("deprecation")
public UIFormSelectBox setDisabled(boolean disabled)
{
- setEnable(!disabled);
- return this;
+ return (UIFormSelectBox)super.setDisabled(disabled);
}
@SuppressWarnings("unused")
@@ -239,9 +238,11 @@
if (size_ > 1)
w.write(" size=\"" + size_ + "\"");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled ");
+ renderHTMLAttributes(w);
+
w.write(">\n");
for (SelectItemOption<String> item : options_)
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBoxWithGroups.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBoxWithGroups.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormSelectBoxWithGroups.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -213,8 +213,7 @@
@SuppressWarnings("deprecation")
public UIFormSelectBoxWithGroups setDisabled(boolean disabled)
{
- setEnable(!disabled);
- return this;
+ return (UIFormSelectBoxWithGroups)super.setDisabled(disabled);
}
@SuppressWarnings("unused")
@@ -314,9 +313,11 @@
if (size_ > 1)
w.write(" size=\"" + size_ + "\"");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled ");
+ renderHTMLAttributes(w);
+
w.write(">\n");
for (SelectItem item : options_)
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormStringInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -103,31 +103,31 @@
{
String value = getValue();
Writer w = context.getWriter();
- w.write("<input name='");
+ w.write("<input name=\"");
w.write(getName());
- w.write('\'');
+ w.write("\"");
if (type_ == PASSWORD_TYPE)
- w.write(" type='password'");
+ w.write(" type=\"password\"");
else
- w.write(" type='text'");
- w.write(" id='");
+ w.write(" type=\"text\"");
+ w.write(" id=\"");
w.write(getId());
- w.write('\'');
+ w.write("\"");
if (value != null && value.length() > 0)
{
value = HTMLEntityEncoder.getInstance().encodeHTMLAttribute(value);
- w.write(" value='");
+ w.write(" value=\"");
w.write(value);
- w.write('\'');
+ w.write("\"");
}
if (maxLength > 0)
- w.write(" maxlength='" + maxLength + "'");
+ w.write(" maxlength=\"" + maxLength + "\"");
if (readonly_)
w.write(" readonly ");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled ");
- renderHTMLAttribute(w);
+ renderHTMLAttributes(w);
w.write("/>");
if (this.isMandatory())
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/UIFormTextAreaInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -63,13 +63,16 @@
String value = getValue();
if (value == null)
value = getDefaultValue();
- w.append("<textarea class='textarea' name='").append(getName()).append("' id='").append(getId()).append("'");
+ w.append("<textarea class=\"textarea\" name=\"").append(getName()).append("\" id=\"").append(getId()).append("\"");
if (readonly_)
w.write(" readonly ");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled ");
w.append(" rows=\"").append(String.valueOf(rows)).append("\"");
w.append(" cols=\"").append(String.valueOf(columns)).append("\"");
+
+ renderHTMLAttributes(w);
+
w.write(">");
if (value != null)
{
Modified: portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/input/UICheckBoxInput.java
===================================================================
--- portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/input/UICheckBoxInput.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/core/src/main/java/org/exoplatform/webui/form/input/UICheckBoxInput.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -112,7 +112,7 @@
public void decode(Object input, WebuiRequestContext context) throws Exception
{
- if (!isEnable())
+ if (isDisabled())
return;
if (input == null || "false".equals(input.toString()))
@@ -128,9 +128,9 @@
public void processRender(WebuiRequestContext context) throws Exception
{
Writer w = context.getWriter();
- w.write("<input type='checkbox' name='");
+ w.write("<input type=\"checkbox\" class=\"checkbox\" name=\"");
w.write(name);
- w.write("'");
+ w.write("\"");
if (onchange_ != null)
{
UIForm uiForm = getAncestorOfType(UIForm.class);
@@ -138,9 +138,12 @@
}
if (isChecked())
w.write(" checked");
- if (!enable_)
+ if (isDisabled())
w.write(" disabled");
- w.write(" class='checkbox'/>");
+
+ renderHTMLAttributes(w);
+
+ w.write("/>");
if (this.isMandatory())
w.write(" *");
}
Modified: portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java
===================================================================
--- portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/eXo/src/main/java/org/exoplatform/webui/organization/UIAccountInputSet.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -90,7 +90,7 @@
if (user == null)
return;
invokeGetBindingField(user);
- getUIStringInput(USERNAME).setEditable(false);
+ getUIStringInput(USERNAME).setReadOnly(true);
}
public boolean save(OrganizationService service, boolean newUser) throws Exception
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/account/UIAccountProfiles.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/account/UIAccountProfiles.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/account/UIAccountProfiles.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -65,7 +65,7 @@
User useraccount = service.getUserHandler().findUserByName(username);
UIFormStringInput userName = new UIFormStringInput("userName", "userName", username);
- userName.setEditable(false);
+ userName.setReadOnly(true);
addUIFormInput(userName.addValidator(MandatoryValidator.class).addValidator(StringLengthValidator.class, 3, 30)
.addValidator(ResourceValidator.class).addValidator(ExpressionValidator.class,
Utils.USER_NAME_VALIDATOR_REGEX, "ResourceValidator.msg.Invalid-char"));
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/container/UIContainerForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -108,7 +108,7 @@
{
uiContainer_ = uiContainer;
Container container = (Container)PortalDataMapper.buildModelObject(uiContainer);
- getUIStringInput("id").setEditable(false);
+ getUIStringInput("id").setReadOnly(true);
invokeGetBindingBean(container);
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIChangePassword.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIChangePassword.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIChangePassword.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -61,7 +61,7 @@
public UIChangePassword() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).setEditable(false));
+ addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).setReadOnly(true));
addUIFormInput(new UIFormStringInput(PASSWORD, PASSWORD, null).setType(UIFormStringInput.PASSWORD_TYPE)
.addValidator(MandatoryValidator.class));
addUIFormInput(((UIFormStringInput)new UIFormStringInput(NEW_PASSWORD, NEW_PASSWORD, null)).setType(
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/login/UIResetPassword.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -62,7 +62,7 @@
public UIResetPassword() throws Exception
{
- addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).setEditable(false));
+ addUIFormInput(new UIFormStringInput(USER_NAME, USER_NAME, null).setReadOnly(true));
addUIFormInput(((UIFormStringInput)new UIFormStringInput(NEW_PASSWORD, NEW_PASSWORD, null)).setType(
UIFormStringInput.PASSWORD_TYPE).addValidator(MandatoryValidator.class).addValidator(
StringLengthValidator.class, 6, 30));
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/navigation/UIPageNavigationForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -80,8 +80,8 @@
{
priorties.add(new SelectItemOption<String>(String.valueOf(i), String.valueOf(i)));
}
- addUIFormInput(new UIFormStringInput("ownerType", "ownerType", getOwnerType()).setEditable(false))
- .addUIFormInput(new UIFormStringInput("ownerId", "ownerId", ownerId).setEditable(false)).addUIFormInput(
+ addUIFormInput(new UIFormStringInput("ownerType", "ownerType", getOwnerType()).setReadOnly(true))
+ .addUIFormInput(new UIFormStringInput("ownerId", "ownerId", ownerId).setReadOnly(true)).addUIFormInput(
new UIFormSelectBox("priority", null, priorties).setValue(getPriority()));
}
@@ -91,7 +91,7 @@
invokeGetBindingBean(userNavigation);
removeChildById("ownerId");
UIFormStringInput ownerId = new UIFormStringInput("ownerId", "ownerId", userNavigation.getKey().getName());
- ownerId.setEditable(false);
+ ownerId.setReadOnly(true);
ownerId.setParent(this);
getChildren().add(1, ownerId);
UIFormSelectBox uiSelectBox = findComponentById("priority");
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -199,7 +199,7 @@
UserACL acl = (UserACL)container.getComponentInstanceOfType(UserACL.class);
UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
- uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setEditable(false));
+ uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setReadOnly(true));
List<SelectItemOption<String>> ownerTypes = new ArrayList<SelectItemOption<String>>();
if (pConfig != null && acl.hasEditPermission(pConfig))
@@ -213,7 +213,7 @@
uiSettingSet.addUIFormInput(uiSelectBoxOwnerType);
ownerIdInput = new UIFormStringInput(OWNER_ID, OWNER_ID, null);
- ownerIdInput.setEditable(false).setValue(pcontext.getRemoteUser());
+ ownerIdInput.setReadOnly(true).setValue(pcontext.getRemoteUser());
uiSettingSet.addUIFormInput(ownerIdInput);
uiSettingSet.addUIFormInput(
@@ -258,11 +258,11 @@
uiPage_ = uiPage;
Page page = (Page)PortalDataMapper.buildModelObject(uiPage);
invokeGetBindingBean(page);
- getUIStringInput("name").setEditable(false);
+ getUIStringInput("name").setReadOnly(true);
getUIStringInput("pageId").setValue(uiPage.getPageId());
getUIStringInput("title").setValue(uiPage.getTitle());
getUIFormCheckBoxInput("showMaxWindow").setValue(uiPage.isShowMaxWindow());
- getUIFormSelectBox(OWNER_TYPE).setEnable(false).setValue(uiPage.getSiteKey().getTypeName());
+ getUIFormSelectBox(OWNER_TYPE).setDisabled(true).setValue(uiPage.getSiteKey().getTypeName());
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIWizardPageSetInfo.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIWizardPageSetInfo.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIWizardPageSetInfo.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -159,7 +159,7 @@
{
isEditMode = true;
UIFormStringInput uiNameInput = getChildById(PAGE_NAME);
- uiNameInput.setEditable(false);
+ uiNameInput.setReadOnly(true);
}
public boolean isEditMode()
@@ -181,9 +181,9 @@
{
UIFormStringInput nameTextBox = getUIStringInput(PAGE_NAME);
//this help to ignore name textbox
- nameTextBox.setEditable(false);
+ nameTextBox.setReadOnly(true);
super.invokeSetBindingBean(bean);
- nameTextBox.setEditable(true);
+ nameTextBox.setReadOnly(false);
UserNode node = (UserNode)bean;
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-11-02 04:50:37 UTC (rev 7922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalForm.java 2011-11-02 04:56:04 UTC (rev 7923)
@@ -114,7 +114,7 @@
UIFormInputSet uiPortalSetting = this.<UIFormInputSet> getChildById("PortalSetting");
UIFormStringInput uiNameInput = uiPortalSetting.getUIStringInput(FIELD_NAME);
- uiNameInput.setEditable(true);
+ uiNameInput.setReadOnly(false);
setSelectedTab(uiPortalSetting.getId());
@@ -235,7 +235,7 @@
UIFormInputSet uiPropertiesSet = new UIFormInputSet("Properties");
uiSettingSet.addUIFormInput(
new UIFormStringInput(FIELD_NAME, FIELD_NAME, null).addValidator(MandatoryValidator.class).addValidator(
- StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setEditable(false));
+ StringLengthValidator.class, 3, 30).addValidator(IdentifierValidator.class).setReadOnly(true));
uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_LABEL, FIELD_LABEL, null).addValidator(SpecialCharacterValidator.class));
uiSettingSet.addUIFormInput(new UIFormStringInput(FIELD_DESCRIPTION, FIELD_DESCRIPTION, null));
13 years, 1 month
gatein SVN: r7922 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2011-11-02 00:50:37 -0400 (Wed, 02 Nov 2011)
New Revision: 7922
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalActionListener.java
Log:
GTNPORTAL-2247: Delete unused LogoutActionListener and ChangeWindowStateActionListener
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalActionListener.java 2011-11-01 21:15:50 UTC (rev 7921)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalActionListener.java 2011-11-02 04:50:37 UTC (rev 7922)
@@ -20,16 +20,8 @@
package org.exoplatform.portal.webui.portal;
import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.webui.application.UIPortlet;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.web.login.LogoutControl;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
-
-import java.net.URLEncoder;
-
import javax.servlet.http.HttpServletRequest;
/**
@@ -40,34 +32,6 @@
public class UIPortalActionListener
{
- @SuppressWarnings("unused")
- static public class LogoutActionListener extends EventListener<UIComponent>
- {
- public void execute(Event<UIComponent> event) throws Exception
- {
- PortalRequestContext prContext = Util.getPortalRequestContext();
- LogoutControl.wantLogout();
- HttpServletRequest request = prContext.getRequest();
- String portalName = URLEncoder.encode(Util.getUIPortal().getName(), "UTF-8");
- String redirect = request.getContextPath() + "/public/" + portalName + "/";
- prContext.getResponse().sendRedirect(redirect);
- prContext.setResponseComplete(true);
- }
- }
-
- //TODO This method seems not to be used
- static public class ChangeWindowStateActionListener extends EventListener<UIPortal>
- {
- public void execute(Event<UIPortal> event) throws Exception
- {
- UIPortal uiPortal = event.getSource();
- String portletId = event.getRequestContext().getRequestParameter("portletId");
- UIPortlet uiPortlet = uiPortal.findComponentById(portletId);
- WebuiRequestContext context = event.getRequestContext();
- uiPortlet.createEvent("ChangeWindowState", event.getExecutionPhase(), context).broadcast();
- }
- }
-
static public class PingActionListener extends EventListener<UIPortal>
{
public void execute(Event<UIPortal> event) throws Exception
13 years, 1 month
gatein SVN: r7921 - in components/sso/trunk: agent/src/main/java/org/gatein/sso/agent/login and 1 other directories.
by do-not-reply@jboss.org
Author: mposolda
Date: 2011-11-01 17:15:50 -0400 (Tue, 01 Nov 2011)
New Revision: 7921
Added:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/FallbackFormJBossLoginModule.java
components/sso/trunk/spnego/src/main/java/org/gatein/sso/spnego/NegotiationAuthenticator.java
Modified:
components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java
components/sso/trunk/pom.xml
Log:
GTNPORTAL-2251 Fallback to FORM when SPNEGO not available or fails
Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/FallbackFormJBossLoginModule.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/FallbackFormJBossLoginModule.java (rev 0)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/FallbackFormJBossLoginModule.java 2011-11-01 21:15:50 UTC (rev 7921)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * 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.gatein.sso.agent.login;
+
+import org.exoplatform.services.security.j2ee.JbossLoginModule;
+import org.exoplatform.services.security.jaas.JAASGroup;
+import org.exoplatform.services.security.jaas.RolePrincipal;
+import org.exoplatform.services.security.jaas.UserPrincipal;
+
+import javax.security.auth.login.LoginException;
+import java.security.Principal;
+import java.security.acl.Group;
+import java.util.Set;
+
+/**
+ * This login module is used for SPNEGO integration. It is workaround, which returns only identity of user in method "commit()" and it does not return any groups.
+ * It is needed because {@link org.jboss.security.negotiation.spnego.SPNEGOLoginModule} assumes in method usernamePasswordLogin()
+ * that user identity is returned as first principal, which is not the case for JbossLoginModule. Issue is addressed in https://issues.jboss.org/browse/SECURITY-631
+ *
+ * @author <a href="mailto:mposolda@redhat.com">Marek Posolda</a>
+ */
+public class FallbackFormJBossLoginModule extends JbossLoginModule
+{
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean commit() throws LoginException
+ {
+ if (super.commit())
+ {
+ Set<Principal> principals = subject.getPrincipals();
+
+ // clear existing principals from subject
+ principals.clear();
+
+ // add only username principal
+ principals.add(new UserPrincipal(identity.getUserId()));
+
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+}
Modified: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java
===================================================================
--- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java 2011-11-01 19:24:13 UTC (rev 7920)
+++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/login/SPNEGORolesModule.java 2011-11-01 21:15:50 UTC (rev 7921)
@@ -37,10 +37,12 @@
import javax.security.auth.login.LoginException;
import javax.security.jacc.PolicyContext;
+import javax.security.jacc.PolicyContextException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.jboss.security.SimpleGroup;
+import org.jboss.security.SimplePrincipal;
import org.jboss.security.auth.spi.AbstractServerLoginModule;
import org.exoplatform.container.ExoContainer;
@@ -219,81 +221,136 @@
log.debug("Performing JBoss security manager cache eviction");
ObjectName securityManagerName = new ObjectName("jboss.security:service=JaasSecurityManager");
-
- //Obtain the httpsession key
- HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
- if(request == null)
- {
- return true;
- }
-
- HttpSession session = request.getSession(false);
- String sessionId = session.getId();
- //
- if (sessionId != null)
+ String userName = null;
+ Principal principalToInvalidate = null;
+ String sessionId = null;
+
+ // If authentication was performed by Spnego, we have SimplePrincipal
+ Set<SimplePrincipal> simplePrincipals = subject.getPrincipals(SimplePrincipal.class);
+ if (!simplePrincipals.isEmpty())
{
- String userName = null;
- Set<UserPrincipal> userPrincipals = subject.getPrincipals(UserPrincipal.class);
- if (!userPrincipals.isEmpty())
- {
- // There should be one
- userName = userPrincipals.iterator().next().getName();
- }
-
- log.debug("Going to perform JBoss security manager cache eviction for user " + userName);
-
- //
- List allPrincipals =
- (List)jbossServer.invoke(securityManagerName, "getAuthenticationCachePrincipals",
- new Object[]{realmName}, new String[]{String.class.getName()});
-
- // Make a copy to avoid some concurrent mods
- allPrincipals = new ArrayList(allPrincipals);
-
- // Lookup for invalidation key, it must be the same principal!
- Principal key = null;
- for (Iterator i = allPrincipals.iterator(); i.hasNext();)
+ // There should be one non-group principal
+ Iterator<SimplePrincipal> iterator = simplePrincipals.iterator();
+ while (iterator.hasNext())
{
- Principal principal = (Principal)i.next();
-
- if (principal.getName().equals(sessionId))
+ Principal temp = iterator.next();
+ if (!(temp instanceof SimpleGroup))
{
- key = principal;
+ principalToInvalidate = temp;
+ userName = principalToInvalidate.getName();
+
+ //Obtain the httpsession key
+ sessionId = findSessionId();
break;
- }
+ }
}
-
- // Perform invalidation
- if (key != null)
+ }
+ // This means that authentication was performned by Form, we have UserPrincipal
+ else
+ {
+ Set<UserPrincipal> userPrincipals = subject.getPrincipals(UserPrincipal.class);
+ if (!userPrincipals.isEmpty())
{
- jbossServer.invoke(securityManagerName, "flushAuthenticationCache", new Object[]{realmName, key},
- new String[]{String.class.getName(), Principal.class.getName()});
- log.debug("Performed JBoss security manager cache eviction for user " + sessionId + " with principal "
- + key);
+ // There should be one
+ principalToInvalidate = userPrincipals.iterator().next();
+ userName = principalToInvalidate.getName();
}
- else
- {
- log.warn("No principal found when performing JBoss security manager cache eviction for user "
- + userName);
- }
}
+
+ // Case with recursive call to 'logout' method
+ if (principalToInvalidate == null)
+ {
+ return true;
+ }
+
+ log.debug("Going to perform JBoss security manager cache eviction for user " + userName);
+
+ //
+ List allPrincipals =
+ (List)jbossServer.invoke(securityManagerName, "getAuthenticationCachePrincipals",
+ new Object[]{realmName}, new String[]{String.class.getName()});
+
+ // Make a copy to avoid some concurrent mods
+ allPrincipals = new ArrayList(allPrincipals);
+
+ Principal key = findKeyPrincipal(principalToInvalidate, allPrincipals, sessionId);
+
+ // Perform invalidation
+ if (key != null)
+ {
+ jbossServer.invoke(securityManagerName, "flushAuthenticationCache", new Object[]{realmName, key},
+ new String[]{String.class.getName(), Principal.class.getName()});
+ log.debug("Performed JBoss security manager cache eviction for user " + userName);
+ }
else
{
- log.warn("No user name found when performing JBoss security manager cache eviction");
+ log.warn("No principal found when performing JBoss security manager cache eviction for user "
+ + userName);
}
}
catch (Exception e)
{
- log.debug("Could not perform JBoss security manager cache eviction", e);
+ log.warn("Could not perform JBoss security manager cache eviction", e);
}
}
else
{
- log.debug("Could not find mbean server for performing JBoss security manager cache eviction");
+ log.warn("Could not find mbean server for performing JBoss security manager cache eviction");
}
//
return true;
}
+
+ private String findSessionId() throws PolicyContextException
+ {
+ HttpServletRequest request = (HttpServletRequest) PolicyContext.getContext("javax.servlet.http.HttpServletRequest");
+ if(request == null)
+ {
+ return null;
+ }
+
+ HttpSession session = request.getSession(false);
+ String sessionId = session.getId();
+ return sessionId;
+ }
+
+ private Principal findKeyPrincipal(Principal subjectPrincipal, List<Principal> allPrincipals, String sessionId)
+ {
+ Principal key = null;
+
+ // TODO: Investigate possibility to find principal without iteration through allPrincipals
+ // Spnego authentication case. Invalidation key starts with sessionId
+ if ((subjectPrincipal instanceof SimplePrincipal) && (sessionId != null))
+ {
+ for (Iterator i = allPrincipals.iterator(); i.hasNext();)
+ {
+ Principal principal = (Principal)i.next();
+
+ if (principal.getName().startsWith(sessionId))
+ {
+ key = principal;
+ break;
+ }
+ }
+ }
+ // Form authentication case
+ else
+ {
+ String userName = subjectPrincipal.getName();
+ for (Iterator i = allPrincipals.iterator(); i.hasNext();)
+ {
+ Principal principal = (Principal)i.next();
+
+ if (principal.getName().equals(userName))
+ {
+ key = principal;
+ break;
+ }
+ }
+ }
+
+ return key;
+ }
}
Modified: components/sso/trunk/pom.xml
===================================================================
--- components/sso/trunk/pom.xml 2011-11-01 19:24:13 UTC (rev 7920)
+++ components/sso/trunk/pom.xml 2011-11-01 21:15:50 UTC (rev 7921)
@@ -79,7 +79,7 @@
<version.servlet-api>2.5</version.servlet-api>
<!-- SPNEGO support using JBoss Negotiation -->
- <version.jboss.negotiation>2.0.3.GA</version.jboss.negotiation>
+ <version.jboss.negotiation>2.1.0.GA</version.jboss.negotiation>
</properties>
<dependencyManagement>
@@ -220,10 +220,10 @@
<repositories>
<repository>
- <id>repository.jboss.org</id>
+ <id>jboss-public-repository-group</id>
<name>JBoss Repository</name>
<layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
Added: components/sso/trunk/spnego/src/main/java/org/gatein/sso/spnego/NegotiationAuthenticator.java
===================================================================
--- components/sso/trunk/spnego/src/main/java/org/gatein/sso/spnego/NegotiationAuthenticator.java (rev 0)
+++ components/sso/trunk/spnego/src/main/java/org/gatein/sso/spnego/NegotiationAuthenticator.java 2011-11-01 21:15:50 UTC (rev 7921)
@@ -0,0 +1,336 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * 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.gatein.sso.spnego;
+
+import org.apache.catalina.Realm;
+import org.apache.catalina.Session;
+import org.apache.catalina.authenticator.AuthenticatorBase;
+import org.apache.catalina.authenticator.FormAuthenticator;
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.catalina.deploy.LoginConfig;
+import org.apache.log4j.Logger;
+import org.jboss.security.negotiation.MessageFactory;
+import org.jboss.security.negotiation.NegotiationException;
+import org.jboss.security.negotiation.NegotiationMessage;
+import org.jboss.security.negotiation.common.MessageTrace;
+import org.jboss.security.negotiation.common.NegotiationContext;
+import org.jboss.util.Base64;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.security.Principal;
+
+import static org.apache.catalina.authenticator.Constants.SESS_PASSWORD_NOTE;
+import static org.apache.catalina.authenticator.Constants.SESS_USERNAME_NOTE;
+import static org.apache.catalina.authenticator.Constants.FORM_ACTION;
+import static org.apache.catalina.authenticator.Constants.FORM_PASSWORD;
+import static org.apache.catalina.authenticator.Constants.FORM_PRINCIPAL_NOTE;
+import static org.apache.catalina.authenticator.Constants.FORM_USERNAME;
+
+/**
+ * An authenticator to manage Negotiation based authentication in connection with the
+ * Negotiation login module. It's fork of {@link org.jboss.security.negotiation.NegotiationAuthenticator}, which is here
+ * to ensure backwards compatibility with JBoss 5 (jbossWeb 2)
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @version $Revision: 110643 $
+ */
+public class NegotiationAuthenticator extends FormAuthenticator
+{
+
+ private static final Logger log = Logger.getLogger(NegotiationAuthenticator.class);
+
+ private static final String NEGOTIATE = "Negotiate";
+
+ private static final String NEGOTIATION_CONTEXT = "NEGOTIATION_CONTEXT";
+
+ private static final String FORM_METHOD = "FORM";
+
+ protected String getNegotiateScheme()
+ {
+ return NEGOTIATE;
+ }
+
+ @Override
+ public boolean authenticate(final Request request, final HttpServletResponse response, final LoginConfig config)
+ throws IOException
+ {
+
+ boolean DEBUG = log.isDebugEnabled();
+ log.trace("Authenticating user");
+
+ Principal principal = request.getUserPrincipal();
+ if (principal != null)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Already authenticated '" + principal.getName() + "'");
+ return true;
+ }
+
+ String contextPath = request.getContextPath();
+ String requestURI = request.getDecodedRequestURI();
+ boolean loginAction = requestURI.startsWith(contextPath) && requestURI.endsWith(FORM_ACTION);
+ if (loginAction)
+ {
+ Realm realm = context.getRealm();
+ String username = request.getParameter(FORM_USERNAME);
+ String password = request.getParameter(FORM_PASSWORD);
+ principal = realm.authenticate(username, password);
+ if (principal == null)
+ {
+ RequestDispatcher disp = context.getServletContext().getRequestDispatcher(config.getErrorPage());
+ try
+ {
+ disp.forward(request.getRequest(), response);
+ }
+ catch (ServletException e)
+ {
+ IOException ex = new IOException("Unable to forward to error page.");
+ ex.initCause(e);
+
+ throw ex;
+ }
+ return false;
+ }
+
+ Session session = request.getSessionInternal();
+ requestURI = savedRequestURL(session);
+
+ session.setNote(FORM_PRINCIPAL_NOTE, principal);
+ session.setNote(SESS_USERNAME_NOTE, username);
+ session.setNote(SESS_PASSWORD_NOTE, password);
+
+ register(request, response, principal, FORM_METHOD, username, password);
+ response.sendRedirect(response.encodeRedirectURL(requestURI));
+
+ return false;
+ }
+
+ String negotiateScheme = getNegotiateScheme();
+
+ if (DEBUG)
+ log.debug("Header - " + request.getHeader("Authorization"));
+ String authHeader = request.getHeader("Authorization");
+ if (authHeader == null)
+ {
+
+ log.debug("No Authorization Header, initiating negotiation");
+ initiateNegotiation(request, response, config);
+
+ return false;
+ }
+ else if (authHeader.startsWith(negotiateScheme + " ") == false)
+ {
+ throw new IOException("Invalid 'Authorization' header.");
+ }
+
+ String authTokenBase64 = authHeader.substring(negotiateScheme.length() + 1);
+ byte[] authToken = Base64.decode(authTokenBase64);
+ ByteArrayInputStream authTokenIS = new ByteArrayInputStream(authToken);
+ MessageTrace.logRequestBase64(authTokenBase64);
+ MessageTrace.logRequestHex(authToken);
+
+ Session session = request.getSessionInternal();
+ NegotiationContext negotiationContext = (NegotiationContext) session.getNote(NEGOTIATION_CONTEXT);
+ if (negotiationContext == null)
+ {
+ log.debug("Creating new NegotiationContext");
+ negotiationContext = new NegotiationContext();
+ session.setNote(NEGOTIATION_CONTEXT, negotiationContext);
+ }
+
+ String username = negotiationContext.getUsername();
+ if (username == null || username.length() == 0)
+ {
+ username = session.getId() + "_" + String.valueOf(System.currentTimeMillis());
+ negotiationContext.setUsername(username);
+ }
+ String authenticationMethod = "";
+ try
+ {
+ // Set the ThreadLocal association.
+ negotiationContext.associate();
+
+ MessageFactory mf = MessageFactory.newInstance();
+ if (mf.accepts(authTokenIS) == false)
+ {
+ throw new IOException("Unsupported negotiation mechanism.");
+ }
+
+ NegotiationMessage requestMessage = mf.createMessage(authTokenIS);
+ negotiationContext.setRequestMessage(requestMessage);
+
+ Realm realm = context.getRealm();
+ principal = realm.authenticate(username, (String) null);
+
+ authenticationMethod = negotiationContext.getAuthenticationMethod();
+
+ if (DEBUG && principal != null)
+ log.debug("authenticated principal = " + principal);
+
+ NegotiationMessage responseMessage = negotiationContext.getResponseMessage();
+ if (responseMessage != null)
+ {
+ ByteArrayOutputStream responseMessageOS = new ByteArrayOutputStream();
+ responseMessage.writeTo(responseMessageOS, true);
+ String responseHeader = responseMessageOS.toString();
+
+ MessageTrace.logResponseBase64(responseHeader);
+
+ response.setHeader("WWW-Authenticate", negotiateScheme + " " + responseHeader);
+ }
+
+ }
+ catch (NegotiationException e)
+ {
+ IOException ioe = new IOException("Error processing " + negotiateScheme + " header.");
+ ioe.initCause(e);
+ throw ioe;
+ }
+ finally
+ {
+ // Clear the headers and remove the ThreadLocal association.
+ negotiationContext.clear();
+ }
+
+ if (principal == null)
+ {
+ response.sendError(Response.SC_UNAUTHORIZED);
+ }
+ else
+ {
+ register(request, response, principal, authenticationMethod, username, null);
+ }
+
+ return (principal != null);
+ }
+
+ /**
+ * Purpose of this method is backwards compatibility with JBoss 5.1
+ *
+ * @param request request
+ * @param response response
+ * @param config login configuration
+ * @return result of authentication
+ * @throws IOException
+ */
+ public boolean authenticate(final Request request, final Response response, final LoginConfig config)
+ throws IOException
+ {
+ return authenticate(request, (HttpServletResponse)response, config);
+ }
+
+ /**
+ * Purpose of this method is backwards compatibility with JBoss 5.1
+ *
+ * @param request request
+ * @param response response
+ * @param principal Principal to register
+ * @param authType authentication type (FORM, BASIC, SPNEGO, ...)
+ * @param username name of user
+ * @param password password of user
+ *
+ */
+ protected void register(Request request, HttpServletResponse response,
+ Principal principal, String authType,
+ String username, String password)
+ {
+ try
+ {
+ // first trying JBoss 6 signature register(Request, HttpServletResponse, Principal, String, String, String)
+ Method registerNewSignature = AuthenticatorBase.class.getDeclaredMethod("register", Request.class, HttpServletResponse.class, Principal.class, String.class, String.class, String.class);
+
+ // We have a method, so calling super
+ if (registerNewSignature != null)
+ {
+ super.register(request, response, principal, authType, username, password);
+ }
+ }
+ catch (NoSuchMethodException nsme)
+ {
+ // fallback to JBoss 5 signature register(Request, Response, Principal, String, String, String)
+ if (log.isDebugEnabled())
+ {
+ log.debug("Method 'register' with signature register(Request, HttpServletResponse, Principal, String, String, String) not found. Fallback to JBoss 5 signature register(Request, Response, Principal, String, String, String).");
+ }
+ try
+ {
+ Method registerOldSignature = AuthenticatorBase.class.getDeclaredMethod("register", Request.class, Response.class, Principal.class, String.class, String.class, String.class);
+ registerOldSignature.invoke(this, request, (Response)response, principal, authType, username, password);
+ }
+ catch (Exception e)
+ {
+ log.error(e);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error(e);
+ }
+ }
+
+ private void initiateNegotiation(final Request request, final HttpServletResponse response, final LoginConfig config)
+ throws IOException
+ {
+ String loginPage = config.getLoginPage();
+ if (loginPage != null)
+ {
+ // TODO - Logic to cache and restore request.
+ ServletContext servletContext = context.getServletContext();
+ RequestDispatcher disp = servletContext.getRequestDispatcher(loginPage);
+
+ try
+ {
+ Session session = request.getSessionInternal();
+ saveRequest(request, session);
+
+ disp.include(request.getRequest(), response);
+ response.setHeader("WWW-Authenticate", getNegotiateScheme());
+ response.setStatus(Response.SC_UNAUTHORIZED);
+ }
+ catch (ServletException e)
+ {
+ IOException ex = new IOException("Unable to include loginPage");
+ ex.initCause(e);
+
+ throw ex;
+ }
+
+ }
+ else
+ {
+ response.setHeader("WWW-Authenticate", getNegotiateScheme());
+ response.sendError(Response.SC_UNAUTHORIZED);
+ }
+
+ response.flushBuffer();
+ }
+}
13 years, 1 month
gatein SVN: r7920 - epp/portal/branches/EPP_5_2_Branch.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-01 15:24:13 -0400 (Tue, 01 Nov 2011)
New Revision: 7920
Modified:
epp/portal/branches/EPP_5_2_Branch/pom.xml
Log:
Removed unused property (with typo)
Modified: epp/portal/branches/EPP_5_2_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-11-01 12:49:21 UTC (rev 7919)
+++ epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-11-01 19:24:13 UTC (rev 7920)
@@ -62,7 +62,6 @@
<org.codehaus.groovy.version>1.7.6</org.codehaus.groovy.version>
<javax.servlet.version>2.5</javax.servlet.version>
<version.chromattic>1.1.0</version.chromattic>
- <version.reflect>1.1.0-beta12</version.reflect>
<org.staxnav.version>0.9.6</org.staxnav.version>
<jcip.version>1.0</jcip.version>
<commons-dbcp.version>1.2.2</commons-dbcp.version>
13 years, 1 month
gatein SVN: r7919 - portal/trunk/docs/reference-guide/en-US/modules/PortalDevelopment.
by do-not-reply@jboss.org
Author: theute
Date: 2011-11-01 08:49:21 -0400 (Tue, 01 Nov 2011)
New Revision: 7919
Modified:
portal/trunk/docs/reference-guide/en-US/modules/PortalDevelopment/Skinning.xml
Log:
Window style got simplified
Modified: portal/trunk/docs/reference-guide/en-US/modules/PortalDevelopment/Skinning.xml
===================================================================
--- portal/trunk/docs/reference-guide/en-US/modules/PortalDevelopment/Skinning.xml 2011-11-01 11:59:16 UTC (rev 7918)
+++ portal/trunk/docs/reference-guide/en-US/modules/PortalDevelopment/Skinning.xml 2011-11-01 12:49:21 UTC (rev 7919)
@@ -546,130 +546,140 @@
<programlisting>
/*---- MyTheme ----*/
.MyTheme .WindowBarCenter .WindowPortletInfo {
- margin-right: 80px; /* orientation=lt */
- margin-left: 80px; /* orientation=rt */
+ margin-right: 80px; /* orientation=lt */
+ margin-left: 80px; /* orientation=rt */
}
+
.MyTheme .WindowBarCenter .ControlIcon {
- float: right;/* orientation=lt */
- float: left;/* orientation=rt */
- width: 24px;
- height: 17px;
- cursor: pointer;
- background-image: url('background/MyTheme.png');
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
+ width: 24px;
+ height: 17px;
+ cursor: pointer;
+ background-image: url('background/MyTheme.png');
}
+
.MyTheme .ArrowDownIcon {
- background-position: center 20px;
+ background-position: center 20px;
}
+
.MyTheme .OverArrowDownIcon {
- background-position: center 116px;
+ background-position: center 116px;
}
+
.MyTheme .MinimizedIcon {
- background-position: center 44px;
+ background-position: center 44px;
}
+
.MyTheme .OverMinimizedIcon {
- background-position: center 140px;
+ background-position: center 140px;
}
+
.MyTheme .MaximizedIcon {
- background-position: center 68px;
+ background-position: center 68px;
}
+
.MyTheme .OverMaximizedIcon {
- background-position: center 164px;
+ background-position: center 164px;
}
+
.MyTheme .RestoreIcon {
- background-position: center 92px;
+ background-position: center 92px;
}
+
.MyTheme .OverRestoreIcon {
- background-position: center 188px;
+ background-position: center 188px;
}
+
.MyTheme .NormalIcon {
- background-position: center 92px;
+ background-position: center 92px;
}
+
.MyTheme .OverNormalIcon {
- background-position: center 188px;
+ background-position: center 188px;
}
-.UIPageDesktop .MyTheme .ResizeArea {
- float: right;/* orientation=lt */
- float: left;/* orientation=rt */
- width: 18px; height: 18px;
- cursor: nw-resize;
- background: url('background/ResizeArea18x18.gif') no-repeat left top; /* orientation=lt */
- background: url('background/ResizeArea18x18-rt.gif') no-repeat right top; /* orientation=rt */
-}
+
.MyTheme .Information {
- height: 18px; line-height: 18px;
- vertical-align: middle; font-size: 10px;
- padding-left: 5px;/* orientation=lt */
- padding-right: 5px;/* orientation=rt */
- margin-right: 18px;/* orientation=lt */
- margin-left: 18px;/* orientation=rt */
+ height: 18px; line-height: 18px;
+ vertical-align: middle; font-size: 10px;
+ padding-left: 5px; /* orientation=lt */
+ padding-right: 5px; /* orientation=rt */
+ margin-right: 18px; /* orientation=lt */
+ margin-left: 18px; /* orientation=rt */
}
+
.MyTheme .WindowBarCenter .WindowPortletIcon {
- background-position: left top; /* orientation=lt */
- background-position: right top; /* orientation=rt */
- padding-left: 20px; /* orientation=lt */
- padding-right: 20px; /* orientation=rt */
- height: 16px;
- line-height: 16px;
+ background-position: left top; /* orientation=lt */
+ background-position: right top; /* orientation=rt */
+ padding-left: 20px; /* orientation=lt */
+ padding-right: 20px; /* orientation=rt */
+ height: 16px;
+ line-height: 16px;
}
+
.MyTheme .WindowBarCenter .PortletName {
- font-weight: bold;
- color: #333333;
- overflow: hidden;
- white-space: nowrap;
- width: 100%;
+ font-weight: bold;
+ color: #333333;
+ overflow: hidden;
+ white-space: nowrap;
}
+
.MyTheme .WindowBarLeft {
- padding-left: 12px;
- background-image: url('background/MyTheme.png');
- background-repeat: no-repeat;
- background-position: left -148px;
+ padding-left: 12px;
+ background-image: url('background/MyTheme.png');
+ background-repeat: no-repeat;
+ background-position: left -148px;
}
+
.MyTheme .WindowBarRight {
- padding-right: 11px;
- background-image: url('background/MyTheme.png');
- background-repeat: no-repeat;
- background-position: right -119px;
+ padding-right: 11px;
+ background-image: url('background/MyTheme.png');
+ background-repeat: no-repeat;
+ background-position: right -119px;
}
+
.MyTheme .WindowBarCenter {
- background-image: url('background/MyTheme.png');
- background-repeat: repeat-x;
- background-position: left -90px;
+ background-image: url('background/MyTheme.png');
+ background-repeat: repeat-x;
+ background-position: left -90px;
+ height: 21px;
+ padding-top: 8px;
}
-.MyTheme .WindowBarCenter .FixHeight {
- height: 21px;
- padding-top: 8px;
-}
+
.MyTheme .MiddleDecoratorLeft {
- padding-left: 12px;
- background: url('background/MyTheme.png') repeat-y left;
+ padding-left: 12px;
+ background: url('background/MMyTheme.png') repeat-y left;
}
+
.MyTheme .MiddleDecoratorRight {
- padding-right: 11px;
- background: url('background/MyTheme.png') repeat-y right;
+ padding-right: 11px;
+ background: url('background/MMyTheme.png') repeat-y right;
}
+
.MyTheme .MiddleDecoratorCenter {
- background: #ffffff;
+ background: #ffffff;
}
+
.MyTheme .BottomDecoratorLeft {
- MyTheme: 12px;
- background-image: url('background/MyTheme.png');
- background-repeat: no-repeat;
- background-position: left -60px;
+ padding-left: 12px;
+ background-image: url('background/MyTheme.png');
+ background-repeat: no-repeat;
+ background-position: left -60px;
}
+
.MyTheme .BottomDecoratorRight {
- padding-right: 11px;
- background-image: url('background/MyTheme.png');
- background-repeat: no-repeat;
- background-position: right -30px;
+ padding-right: 11px;
+ background-image: url('background/MyTheme.png');
+ background-repeat: no-repeat;
+ background-position: right -30px;
}
+
.MyTheme .BottomDecoratorCenter {
- background-image: url('background/MyTheme.png');
- background-repeat: repeat-x;
- background-position: left top;
+ background-image: url('background/MyTheme.png');
+ background-repeat: repeat-x;
+ background-position: left top;
+ height: 30px;
}
-.MyTheme .BottomDecoratorCenter .FixHeight {
- height: 30px;
-}
</programlisting>
</section>
<section>
13 years, 1 month