gatein SVN: r4421 - in portal/branches/branch-GTNPORTAL-1493: web/eXoResources/src/main/webapp/javascript/eXo/gadget and 1 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-09-29 03:02:40 -0400 (Wed, 29 Sep 2010)
New Revision: 4421
Modified:
portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
GTNPORTAL-1507 Loose UserPreference when drag and drop ToDo Gadget in Dashboard
Modified: portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2010-09-29 04:00:36 UTC (rev 4420)
+++ portal/branches/branch-GTNPORTAL-1493/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2010-09-29 07:02:40 UTC (rev 4421)
@@ -175,11 +175,11 @@
if(inputList[i].value != null && inputList[i].value != "") {
var tmp = inputList[i].value;
var numTask = tmp.substring(0, tmp.indexOf('.'));
- var contentTask = tmp.substring(tmp.indexOf('.'), tmp.length);
+ var contentTask = tmp.substring(tmp.indexOf('.') + 1, tmp.length);
if(parseInt(numTask) != parseInt(inputList[i].id)) {
numTask = inputList[i].id;
}
- inputList[i].value = numTask+contentTask;
+ inputList[i].value = numTask + "." + contentTask;
}
}
}
Modified: portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2010-09-29 04:00:36 UTC (rev 4420)
+++ portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2010-09-29 07:02:40 UTC (rev 4421)
@@ -43,12 +43,12 @@
href += "&op=SaveUserPref";
href += "&ajaxRequest=true";
href += "&userPref=" + prefs;
- ajaxAsyncGetRequest(href,true);
+ ajaxGet(href,true);
} else {
var params = [
{name : "userPref", value : prefs}
] ;
- ajaxAsyncGetRequest(eXo.env.server.createPortalURL(uiGadget.id.replace(/^content-/,""), "SaveUserPref", true, params),true) ;
+ ajaxGet(eXo.env.server.createPortalURL(uiGadget.id.replace(/^content-/,""), "SaveUserPref", true, params),true) ;
}
}
};
Modified: portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-29 04:00:36 UTC (rev 4420)
+++ portal/branches/branch-GTNPORTAL-1493/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2010-09-29 07:02:40 UTC (rev 4421)
@@ -764,16 +764,26 @@
}
}
this.setUserPrefs(prefs);
- this.refresh();
};
+gadgets.IfrGadget.prototype.setUserPrefs = function(newUserPrefs) {
+ gadgets.IfrGadget.superClass_.setUserPrefs.call(this, newUserPrefs);
+ this.refresh();
+};
+
+gadgets.IfrGadget.prototype.setUserPref = function(name, value) {
+ gadgets.IfrGadget.superClass_.setUserPref.call(this, name, value);
+ this.refresh();
+};
+
gadgets.IfrGadget.prototype.handleCancelUserPrefs = function() {
this.hideUserPrefsDialog();
};
gadgets.IfrGadget.prototype.refresh = function() {
var iframeId = this.getIframeId();
- document.getElementById(iframeId).src = this.getIframeUrl();
+ if (document.getElementById(iframeId))
+ document.getElementById(iframeId).src = this.getIframeUrl();
};
Modified: portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-09-29 04:00:36 UTC (rev 4420)
+++ portal/branches/branch-GTNPORTAL-1493/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-09-29 07:02:40 UTC (rev 4421)
@@ -376,12 +376,13 @@
public void execute(Event<UIGadget> event) throws Exception
{
UIGadget uiGadget = event.getSource();
-
+ WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+
//
try{
uiGadget.addUserPref(event.getRequestContext().getRequestParameter("userPref"));
- } catch(Exception e){
- WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
+ Util.getPortalRequestContext().setFullRender(true);
+ } catch(Exception e){
UIPortletApplication uiPortlet = uiGadget.getAncestorOfType(UIPortletApplication.class);
context.addUIComponentToUpdateByAjax(uiPortlet);
throw new MessageException(new ApplicationMessage("UIDashboard.msg.ApplicationNotExisted", null, ApplicationMessage.ERROR));
14 years, 3 months
gatein SVN: r4420 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-09-29 00:00:36 -0400 (Wed, 29 Sep 2010)
New Revision: 4420
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_28_EditPortalConfig.html
Log:
TestVN-356:Clean and Improve existing Selenium for GateIn
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_28_EditPortalConfig.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_28_EditPortalConfig.html 2010-09-29 01:27:51 UTC (rev 4419)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/NewSnifftest/Test_SNF_PRL_28_EditPortalConfig.html 2010-09-29 04:00:36 UTC (rev 4420)
@@ -262,8 +262,8 @@
<td></td>
</tr>
<tr>
- <td>assertLocation</td>
- <td>http://localhost:8080/portal/private/Test_SNF_PRL_28/</td>
+ <td>waitForElementPresent</td>
+ <td>link=Site</td>
<td></td>
</tr>
<tr>
@@ -403,11 +403,6 @@
</tr>
<tr>
<td>echo</td>
- <td>-- https://jira.jboss.org/browse/GTNPORTAL-1389--</td>
- <td></td>
-</tr>
-<tr>
- <td>echo</td>
<td>-- Delete portal --</td>
<td></td>
</tr>
14 years, 3 months
gatein SVN: r4419 - exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/form/validator.
by do-not-reply@jboss.org
Author: ndkhoiits
Date: 2010-09-28 21:27:51 -0400 (Tue, 28 Sep 2010)
New Revision: 4419
Modified:
exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java
Log:
EXOGTN-88 Remove the remains of DateTimeValidator that cause validator is incorrect
Modified: exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java
===================================================================
--- exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java 2010-09-28 22:20:27 UTC (rev 4418)
+++ exo/portal/branches/3.1.x/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java 2010-09-29 01:27:51 UTC (rev 4419)
@@ -19,6 +19,9 @@
package org.exoplatform.webui.form.validator;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
@@ -26,12 +29,6 @@
import org.exoplatform.webui.form.UIFormDateTimeInput;
import org.exoplatform.webui.form.UIFormInput;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-
/**
* Created by The eXo Platform SARL
* Author : Tran The Trong
@@ -79,24 +76,9 @@
{
throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args, ApplicationMessage.WARNING));
}
- if (s.matches(DATETIME_REGEX) && isValidDateTime(s))
+ if (s.matches(DATETIME_REGEX))
return;
throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args, ApplicationMessage.WARNING));
}
-
- private boolean isValidDateTime(String dateTime)
- {
- String[] arr = dateTime.split(SPLIT_REGEX, 7);
- int valid = Integer.parseInt(arr[0]);
- if (valid < 1 || valid > 12)
- return false;
- Calendar date = new GregorianCalendar(Integer.parseInt(arr[2]), valid - 1, 1);
- if (Integer.parseInt(arr[1]) > date.getActualMaximum(Calendar.DAY_OF_MONTH))
- return false;
- if (arr.length > 3
- && (Integer.parseInt(arr[3]) > 23 || Integer.parseInt(arr[4]) > 59 || Integer.parseInt(arr[5]) > 59))
- return false;
- return true;
- }
}
14 years, 3 months
gatein SVN: r4418 - exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-28 18:20:27 -0400 (Tue, 28 Sep 2010)
New Revision: 4418
Modified:
exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml
exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml
Log:
TESTFR-8: Remove PicketLink cache contention under load
Modified: exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml 2010-09-28 22:03:47 UTC (rev 4417)
+++ exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache-cluster.xml 2010-09-28 22:20:27 UTC (rev 4418)
@@ -8,11 +8,12 @@
<!-- Eviction configuration -->
<eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
- eventQueueSize="1000000">
- <property name="maxNodes" value="1000000" />
- <property name="timeToLive" value="120000" />
- </default>
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
</eviction>
</jbosscache>
Modified: exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml 2010-09-28 22:03:47 UTC (rev 4417)
+++ exo/portal/branches/3.1.4-PLF-perf/web/portal/src/main/webapp/WEB-INF/conf/organization/picketlink-idm/jboss-cache.xml 2010-09-28 22:20:27 UTC (rev 4418)
@@ -2,11 +2,12 @@
<!-- Eviction configuration -->
<eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
- eventQueueSize="1000000">
- <property name="maxNodes" value="1000000" />
- <property name="timeToLive" value="120000" />
- </default>
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
</eviction>
</jbosscache>
\ No newline at end of file
14 years, 3 months
gatein SVN: r4417 - in exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache: local and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-28 18:03:47 -0400 (Tue, 28 Sep 2010)
New Revision: 4417
Modified:
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml
Log:
TESTFR-7: Remove JBoss Cache eviction policy contention
Modified: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml 2010-09-28 22:02:32 UTC (rev 4416)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml 2010-09-28 22:03:47 UTC (rev 4417)
@@ -30,11 +30,12 @@
<!-- Eviction configuration -->
<eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
- actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
- eventQueueSize="1000000">
- <property name="maxNodes" value="5000" />
- <property name="timeToLive" value="20000" />
- </default>
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
</eviction>
+
</jbosscache>
\ No newline at end of file
Modified: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml 2010-09-28 22:02:32 UTC (rev 4416)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml 2010-09-28 22:03:47 UTC (rev 4417)
@@ -27,11 +27,13 @@
<invocationBatching enabled="true" />
<!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy" eventQueueSize="1000000">
- <property name="maxNodes" value="5000" />
- <property name="minTimeToLive" value="20000" />
- </default>
- </eviction>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
+ </eviction>
</jbosscache>
14 years, 3 months
gatein SVN: r4416 - in exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache: local and 1 other directory.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-28 18:02:32 -0400 (Tue, 28 Sep 2010)
New Revision: 4416
Modified:
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml
Log:
that should not have been commited in previous commit, will recommit properly just after
Modified: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml 2010-09-28 21:58:33 UTC (rev 4415)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml 2010-09-28 22:02:32 UTC (rev 4416)
@@ -30,12 +30,11 @@
<!-- Eviction configuration -->
<eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
- actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
- eventQueueSize="1000000">
- <property name="maxNodes" value="1000000" />
- <property name="warnNoExpirationKey" value="false" />
- </default>
+ <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="timeToLive" value="20000" />
+ </default>
</eviction>
-
</jbosscache>
\ No newline at end of file
Modified: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml 2010-09-28 21:58:33 UTC (rev 4415)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml 2010-09-28 22:02:32 UTC (rev 4416)
@@ -27,13 +27,11 @@
<invocationBatching enabled="true" />
<!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
- actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
- eventQueueSize="1000000">
- <property name="maxNodes" value="1000000" />
- <property name="warnNoExpirationKey" value="false" />
- </default>
- </eviction>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy" eventQueueSize="1000000">
+ <property name="maxNodes" value="5000" />
+ <property name="minTimeToLive" value="20000" />
+ </default>
+ </eviction>
</jbosscache>
14 years, 3 months
gatein SVN: r4415 - in exo/portal/branches/3.1.4-PLF-perf: component/common/src/main/java/conf/jcr/jbosscache/local and 4 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-28 17:58:33 -0400 (Tue, 28 Sep 2010)
New Revision: 4415
Added:
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java
exo/portal/branches/3.1.4-PLF-perf/component/common/src/test/java/org/exoplatform/commons/xml/
exo/portal/branches/3.1.4-PLF-perf/component/common/src/test/java/org/exoplatform/commons/xml/TestDOMSerializer.java
Modified:
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml
exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml
exo/portal/branches/3.1.4-PLF-perf/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
Log:
TESTFR-6: Response headers sent by portlets are a bottleneck when they are serialized from DOM element to markup
Modified: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml 2010-09-28 17:36:40 UTC (rev 4414)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/cluster/config.xml 2010-09-28 21:58:33 UTC (rev 4415)
@@ -30,11 +30,12 @@
<!-- Eviction configuration -->
<eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm"
- actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
- eventQueueSize="1000000">
- <property name="maxNodes" value="5000" />
- <property name="timeToLive" value="20000" />
- </default>
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
</eviction>
+
</jbosscache>
\ No newline at end of file
Modified: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml 2010-09-28 17:36:40 UTC (rev 4414)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/conf/jcr/jbosscache/local/config.xml 2010-09-28 21:58:33 UTC (rev 4415)
@@ -27,11 +27,13 @@
<invocationBatching enabled="true" />
<!-- Eviction configuration -->
- <eviction wakeUpInterval="5000">
- <default algorithmClass="org.jboss.cache.eviction.FIFOAlgorithm" actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy" eventQueueSize="1000000">
- <property name="maxNodes" value="5000" />
- <property name="minTimeToLive" value="20000" />
- </default>
- </eviction>
+ <eviction wakeUpInterval="5000">
+ <default algorithmClass="org.jboss.cache.eviction.ExpirationAlgorithm"
+ actionPolicyClass="org.exoplatform.services.jcr.impl.dataflow.persistent.jbosscache.ParentNodeEvictionActionPolicy"
+ eventQueueSize="1000000">
+ <property name="maxNodes" value="1000000" />
+ <property name="warnNoExpirationKey" value="false" />
+ </default>
+ </eviction>
</jbosscache>
Added: exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java (rev 0)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/main/java/org/exoplatform/commons/xml/DOMSerializer.java 2010-09-28 21:58:33 UTC (rev 4415)
@@ -0,0 +1,134 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.commons.xml;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * An high performance and custom DOM serializer based on stax {@link XMLStreamWriter}.
+ *
+ * <p>The serializer takes care of correctly writing empty script elements with their non empty form, because we want to ouput
+ * xhtml text that will still work on html browsers.</p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class DOMSerializer
+{
+
+ /** Thread safe. */
+ private static final XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+
+ public static void serialize(Element element, Writer writer) throws IOException, XMLStreamException
+ {
+ XMLStreamWriter xml = outputFactory.createXMLStreamWriter(writer);
+ serialize(element, xml);
+ xml.writeEndDocument();
+ xml.flush();
+ }
+
+ private static void serialize(Element element, XMLStreamWriter writer) throws IOException, XMLStreamException
+ {
+ String tagName = element.getTagName();
+
+ // Determine if empty
+ // Note that we won't accumulate the elements that would be serialized for performance reason
+ // we will just reiterate later before ending the element
+ boolean empty;
+ if (tagName.equalsIgnoreCase("script"))
+ {
+ empty = false;
+ }
+ else
+ {
+ empty = true;
+ NodeList children = element.getChildNodes();
+ int length = children.getLength();
+ for (int i = 0;i < length && empty;i++)
+ {
+ Node child = children.item(i);
+ if (child instanceof CharacterData)
+ {
+ empty = false;
+ }
+ else if (child instanceof Element)
+ {
+ empty = false;
+ }
+ }
+ }
+
+ //
+ if (empty)
+ {
+ writer.writeEmptyElement(tagName);
+ }
+ else
+ {
+ writer.writeStartElement(tagName);
+ }
+
+ // Write attributes
+ if (element.hasAttributes())
+ {
+ NamedNodeMap attrs = element.getAttributes();
+ int length = attrs.getLength();
+ for (int i = 0;i < length;i++)
+ {
+ Attr attr = (Attr)attrs.item(i);
+ writer.writeAttribute(attr.getName(), attr.getValue());
+ }
+ }
+
+ //
+ if (!empty)
+ {
+ // Serialize children that are worth to be
+ NodeList children = element.getChildNodes();
+ int length = children.getLength();
+ for (int i = 0;i < length;i++)
+ {
+ Node child = children.item(i);
+ if (child instanceof CharacterData)
+ {
+ writer.writeCData(((CharacterData)child).getData());
+ }
+ else if (child instanceof Element)
+ {
+ serialize((Element)child, writer);
+ }
+ }
+
+ // Close
+ writer.writeEndElement();
+ }
+ }
+}
Added: exo/portal/branches/3.1.4-PLF-perf/component/common/src/test/java/org/exoplatform/commons/xml/TestDOMSerializer.java
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/component/common/src/test/java/org/exoplatform/commons/xml/TestDOMSerializer.java (rev 0)
+++ exo/portal/branches/3.1.4-PLF-perf/component/common/src/test/java/org/exoplatform/commons/xml/TestDOMSerializer.java 2010-09-28 21:58:33 UTC (rev 4415)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.commons.xml;
+
+import junit.framework.TestCase;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class TestDOMSerializer extends TestCase
+{
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ }
+
+ public void testScriptNoAttributes() throws Exception
+ {
+ assertSerialization("<script></script>", "<script/>");
+ }
+
+ public void testScriptWithAttribute() throws Exception
+ {
+ assertSerialization("<script type=\"text/javascript\"></script>", "<script type='text/javascript'/>");
+ }
+
+ public void testMetaNoAttributes() throws Exception
+ {
+ assertSerialization("<meta/>", "<meta/>");
+ }
+
+ public void testMetaWithAttribute() throws Exception
+ {
+ assertSerialization("<meta http-equiv=\"Content-Type\"/>", "<meta http-equiv='Content-Type'></meta>");
+ }
+
+ private void assertSerialization(String expectedMarkup, String markup) throws Exception
+ {
+ Element elt = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(markup))).getDocumentElement();
+ StringWriter writer = new StringWriter();
+ DOMSerializer.serialize(elt, writer);
+ assertEquals(expectedMarkup, writer.toString());
+ }
+}
Modified: exo/portal/branches/3.1.4-PLF-perf/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- exo/portal/branches/3.1.4-PLF-perf/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-09-28 17:36:40 UTC (rev 4414)
+++ exo/portal/branches/3.1.4-PLF-perf/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-09-28 21:58:33 UTC (rev 4415)
@@ -22,6 +22,7 @@
import org.exoplatform.Constants;
import org.exoplatform.commons.utils.PortalPrinter;
import org.exoplatform.commons.utils.WriterPrinter;
+import org.exoplatform.commons.xml.DOMSerializer;
import org.exoplatform.container.ExoContainer;
import org.exoplatform.portal.config.UserPortalConfigService;
import org.exoplatform.portal.config.model.Page;
@@ -41,19 +42,12 @@
import org.gatein.common.http.QueryStringParser;
import org.w3c.dom.Element;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
import java.io.IOException;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.URLDecoder;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -437,35 +431,16 @@
public List<String> getExtraMarkupHeadersAsStrings() throws Exception
{
List<String> markupHeaders = new ArrayList<String>();
-
if (extraMarkupHeaders != null && !extraMarkupHeaders.isEmpty())
{
- Transformer transformer = TransformerFactory.newInstance().newTransformer();
- transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-
+ StringWriter sw = new StringWriter();
for (Element element : extraMarkupHeaders)
{
- DOMSource source = new DOMSource(element);
- StreamResult result = new StreamResult(new StringWriter());
-
- // we want to ouput xhtml text that will still work on html browsers.
- // In order to do this we need to have the script tag be not self closing
- // which it will try and do with the xml or xhtml method. If we just use
- // the html method then the other tags will not be closed.
- if (element.getNodeName().equalsIgnoreCase("script"))
- {
- transformer.setOutputProperty(OutputKeys.METHOD, "html");
- }
- else
- {
- transformer.setOutputProperty(OutputKeys.METHOD, "xml");
- }
- transformer.transform(source, result);
- markupHeaders.add(result.getWriter().toString());
+ DOMSerializer.serialize(element, sw);
+ markupHeaders.add(sw.toString());
}
}
-
- return markupHeaders;
+ return markupHeaders;
}
/**
14 years, 3 months
gatein SVN: r4414 - components/wsrp/trunk.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-28 13:36:40 -0400 (Tue, 28 Sep 2010)
New Revision: 4414
Modified:
components/wsrp/trunk/pom.xml
Log:
- GTNWSRP-76: Updated WCI to 2.0.2-GA.
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2010-09-28 16:39:18 UTC (rev 4413)
+++ components/wsrp/trunk/pom.xml 2010-09-28 17:36:40 UTC (rev 4414)
@@ -48,7 +48,7 @@
<properties>
<version.gatein.pc>2.2.0-Beta03</version.gatein.pc>
<version.gatein.common>2.0.3-GA</version.gatein.common>
- <version.gatein.wci>2.0.1-GA</version.gatein.wci>
+ <version.gatein.wci>2.0.2-GA</version.gatein.wci>
<version.jsf>1.2_12</version.jsf>
<version.apache.commons-fileupload>1.2.1</version.apache.commons-fileupload>
14 years, 3 months
gatein SVN: r4413 - portal/trunk.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-28 12:39:18 -0400 (Tue, 28 Sep 2010)
New Revision: 4413
Modified:
portal/trunk/pom.xml
Log:
- Updated to use WSRP 2.0.0-Alpha03.
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2010-09-28 16:19:26 UTC (rev 4412)
+++ portal/trunk/pom.xml 2010-09-28 16:39:18 UTC (rev 4413)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-Beta03</org.gatein.pc.version>
<org.picketlink.idm>1.1.5.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-Alpha02</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.0.0-Alpha03</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
14 years, 3 months
gatein SVN: r4412 - in portal/trunk: examples/portal/war/src/main/webapp/WEB-INF and 5 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-28 12:19:26 -0400 (Tue, 28 Sep 2010)
New Revision: 4412
Added:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/RegisterPortletApplicationController.java
Removed:
portal/trunk/component/web/security/src/main/java/org/exoplatform/web/security/CaptchaServlet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/BaseHttpRequestWrapper.java
Modified:
portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/HttpRequestWrapper.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/CaptchaValidator.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
Log:
GTNPORTAL-1503 : Implement Captcha image as a portlet resource serving
Deleted: portal/trunk/component/web/security/src/main/java/org/exoplatform/web/security/CaptchaServlet.java
===================================================================
--- portal/trunk/component/web/security/src/main/java/org/exoplatform/web/security/CaptchaServlet.java 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/component/web/security/src/main/java/org/exoplatform/web/security/CaptchaServlet.java 2010-09-28 16:19:26 UTC (rev 4412)
@@ -1,88 +0,0 @@
-/******************************************************************************
- * JBoss by Red Hat *
- * Copyright 2010, 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.exoplatform.web.security;
-
-import static nl.captcha.Captcha.NAME;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import nl.captcha.Captcha;
-import nl.captcha.servlet.CaptchaServletUtil;
-
-/**
- * @author <a href="mailto:theute@redhat.com">Thomas Heute</a>
- * @version $Revision$
- */
-public class CaptchaServlet extends HttpServlet
-{
-
- private static final long serialVersionUID = 1L;
-
- private static final String PARAM_HEIGHT = "height";
-
- private static final String PARAM_WIDTH = "width";
-
- protected int _width = 200;
-
- protected int _height = 50;
-
- @Override
- public void init() throws ServletException
- {
- if (getInitParameter(PARAM_HEIGHT) != null)
- {
- _height = Integer.valueOf(getInitParameter(PARAM_HEIGHT));
- }
-
- if (getInitParameter(PARAM_WIDTH) != null)
- {
- _width = Integer.valueOf(getInitParameter(PARAM_WIDTH));
- }
- }
-
- @Override
- public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
- {
- HttpSession session = req.getSession();
- Captcha captcha;
- if (session.getAttribute(NAME) == null)
- {
- captcha = new Captcha.Builder(_width, _height).addText().gimp().addNoise().addBackground().build();
-
- session.setAttribute(NAME, captcha);
- CaptchaServletUtil.writeImage(resp, captcha.getImage());
-
- return;
- }
-
- captcha = (Captcha) session.getAttribute(NAME);
- CaptchaServletUtil.writeImage(resp, captcha.getImage());
- }
-
-}
Modified: portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/examples/portal/war/src/main/webapp/WEB-INF/web.xml 2010-09-28 16:19:26 UTC (rev 4412)
@@ -186,24 +186,6 @@
<load-on-startup>0</load-on-startup>
</servlet>
- <servlet>
- <servlet-name>StickyCaptcha</servlet-name>
- <servlet-class>org.exoplatform.web.security.CaptchaServlet</servlet-class>
- <init-param>
- <param-name>width</param-name>
- <param-value>200</param-value>
- </init-param>
- <init-param>
- <param-name>height</param-name>
- <param-value>75</param-value>
- </init-param>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>StickyCaptcha</servlet-name>
- <url-pattern>/captcha</url-pattern>
- </servlet-mapping>
-
<!-- ================================================================= -->
<servlet-mapping>
<servlet-name>InitiateLoginServlet</servlet-name>
Added: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/RegisterPortletApplicationController.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/RegisterPortletApplicationController.java (rev 0)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/account/webui/component/RegisterPortletApplicationController.java 2010-09-28 16:19:26 UTC (rev 4412)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.exoplatform.account.webui.component;
+
+import nl.captcha.Captcha;
+import nl.captcha.servlet.CaptchaServletUtil;
+import org.exoplatform.webui.application.portlet.PortletApplicationController;
+
+import javax.portlet.PortletException;
+import javax.portlet.PortletSession;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+
+import static nl.captcha.Captcha.NAME;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RegisterPortletApplicationController extends PortletApplicationController implements ResourceServingPortlet
+{
+
+ private static final String PARAM_HEIGHT = "height";
+
+ private static final String PARAM_WIDTH = "width";
+
+ protected int _width = 200;
+
+ protected int _height = 50;
+
+ @Override
+ public void init() throws PortletException
+ {
+ if (getInitParameter(PARAM_HEIGHT) != null)
+ {
+ _height = Integer.valueOf(getInitParameter(PARAM_HEIGHT));
+ }
+
+ if (getInitParameter(PARAM_WIDTH) != null)
+ {
+ _width = Integer.valueOf(getInitParameter(PARAM_WIDTH));
+ }
+ }
+
+ public void serveResource(ResourceRequest req, ResourceResponse resp)
+ throws PortletException, java.io.IOException
+ {
+ PortletSession session = req.getPortletSession();
+ Captcha captcha;
+ if (session.getAttribute(NAME) == null)
+ {
+ captcha = new Captcha.Builder(_width, _height).addText().gimp().addNoise().addBackground().build();
+
+
+ session.setAttribute(NAME, captcha);
+ writeImage(resp, captcha.getImage());
+
+ return;
+ }
+
+ captcha = (Captcha)session.getAttribute(NAME);
+ writeImage(resp, captcha.getImage());
+
+ }
+
+ public static void writeImage(ResourceResponse response, BufferedImage bi)
+ {
+ response.setProperty("Cache-Control", "private,no-cache,no-store");
+ response.setContentType("image/png"); // PNGs allow for transparency. JPGs do not.
+ try
+ {
+ CaptchaServletUtil.writeImage(response.getPortletOutputStream(), bi);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2010-09-28 16:19:26 UTC (rev 4412)
@@ -85,12 +85,20 @@
<description xml:lang="EN">Register Portlet</description>
<portlet-name>RegisterPortlet</portlet-name>
<display-name xml:lang="EN">Register Portlet</display-name>
- <portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+ <portlet-class>org.exoplatform.account.webui.component.RegisterPortletApplicationController</portlet-class>
<init-param>
<name>webui.configuration</name>
<value>/WEB-INF/conf/portlet/exoadmin/RegisterPortlet/webui/configuration.xml</value>
</init-param>
+ <init-param>
+ <name>width</name>
+ <value>200</value>
+ </init-param>
+ <init-param>
+ <name>height</name>
+ <value>75</value>
+ </init-param>
<expiration-cache>0</expiration-cache>
<supports>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/web.xml 2010-09-28 16:19:26 UTC (rev 4412)
@@ -226,25 +226,6 @@
<load-on-startup>0</load-on-startup>
</servlet>
- <servlet>
- <servlet-name>StickyCaptcha</servlet-name>
- <servlet-class>org.exoplatform.web.security.CaptchaServlet</servlet-class>
- <init-param>
- <param-name>width</param-name>
- <param-value>200</param-value>
- </init-param>
- <init-param>
- <param-name>height</param-name>
- <param-value>75</param-value>
- </init-param>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>StickyCaptcha</servlet-name>
- <url-pattern>/captcha</url-pattern>
- </servlet-mapping>
-
-
<!-- ================================================================= -->
<servlet-mapping>
<servlet-name>InitiateLoginServlet</servlet-name>
Deleted: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/BaseHttpRequestWrapper.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/BaseHttpRequestWrapper.java 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/BaseHttpRequestWrapper.java 2010-09-28 16:19:26 UTC (rev 4412)
@@ -1,497 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * 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.exoplatform.portal.application.localization;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-
-/**
- * This class is an alternative for {@link javax.servlet.http.HttpServletRequestWrapper}.
- * One reason for favoring it is to avoid situations when servlet container decides to replace
- * the delegate via {@link javax.servlet.ServletRequestWrapper#setRequest(javax.servlet.ServletRequest)}.
- *
- * @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
- */
-public class BaseHttpRequestWrapper implements HttpServletRequest
-{
-
- private HttpServletRequest delegate;
-
- /**
- * Create new instance
- * @param request delegate {@link HttpServletRequest}
- */
- public BaseHttpRequestWrapper(HttpServletRequest request)
- {
- delegate = request;
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getAuthType()
- */
- public String getAuthType()
- {
- return delegate.getAuthType();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getCookies()
- */
- public Cookie[] getCookies()
- {
- return delegate.getCookies();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getDateHeader(String)
- */
- public long getDateHeader(String name)
- {
- return delegate.getDateHeader(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getHeader(String)
- */
- public String getHeader(String name)
- {
- return delegate.getHeader(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getHeaders(String)
- */
- public Enumeration getHeaders(String name)
- {
- return delegate.getHeaders(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getHeaderNames()
- */
- public Enumeration getHeaderNames()
- {
- return delegate.getHeaderNames();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getIntHeader(String)
- */
- public int getIntHeader(String name)
- {
- return delegate.getIntHeader(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getMethod()
- */
- public String getMethod()
- {
- return delegate.getMethod();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getPathInfo()
- */
- public String getPathInfo()
- {
- return delegate.getPathInfo();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getPathTranslated()
- */
- public String getPathTranslated()
- {
- return delegate.getPathTranslated();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getContextPath()
- */
- public String getContextPath()
- {
- return delegate.getContextPath();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getQueryString()
- */
- public String getQueryString()
- {
- return delegate.getQueryString();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRemoteUser()
- */
- public String getRemoteUser()
- {
- return delegate.getRemoteUser();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#isUserInRole(String)
- */
- public boolean isUserInRole(String role)
- {
- return delegate.isUserInRole(role);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getUserPrincipal()
- */
- public Principal getUserPrincipal()
- {
- return delegate.getUserPrincipal();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRequestedSessionId()
- */
- public String getRequestedSessionId()
- {
- return delegate.getRequestedSessionId();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRequestURI()
- */
- public String getRequestURI()
- {
- return delegate.getRequestURI();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRequestURL()
- */
- public StringBuffer getRequestURL()
- {
- return delegate.getRequestURL();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getServletPath()
- */
- public String getServletPath()
- {
- return delegate.getServletPath();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getSession(boolean)
- */
- public HttpSession getSession(boolean create)
- {
- return delegate.getSession(create);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getSession()
- */
- public HttpSession getSession()
- {
- return delegate.getSession();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdValid()
- */
- public boolean isRequestedSessionIdValid()
- {
- return delegate.isRequestedSessionIdValid();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromCookie()
- */
- public boolean isRequestedSessionIdFromCookie()
- {
- return delegate.isRequestedSessionIdFromCookie();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromURL()
- */
- public boolean isRequestedSessionIdFromURL()
- {
- return delegate.isRequestedSessionIdFromURL();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#isRequestedSessionIdFromUrl()
- */
- public boolean isRequestedSessionIdFromUrl()
- {
- return delegate.isRequestedSessionIdFromUrl();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getAttribute(String)
- */
- public Object getAttribute(String name)
- {
- return delegate.getAttribute(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getAttributeNames()
- */
- public Enumeration getAttributeNames()
- {
- return delegate.getAttributeNames();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getCharacterEncoding()
- */
- public String getCharacterEncoding()
- {
- return delegate.getCharacterEncoding();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#setCharacterEncoding(String)
- */
- public void setCharacterEncoding(String env) throws UnsupportedEncodingException
- {
- delegate.setCharacterEncoding(env);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getContentLength()
- */
- public int getContentLength()
- {
- return delegate.getContentLength();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getContentType()
- */
- public String getContentType()
- {
- return delegate.getContentType();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getInputStream()
- */
- public ServletInputStream getInputStream() throws IOException
- {
- return delegate.getInputStream();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getParameter(String)
- */
- public String getParameter(String name)
- {
- return delegate.getParameter(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getParameterNames()
- */
- public Enumeration getParameterNames()
- {
- return delegate.getParameterNames();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getParameterValues(String)
- */
- public String[] getParameterValues(String name)
- {
- return delegate.getParameterValues(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getParameterMap()
- */
- public Map getParameterMap()
- {
- return delegate.getParameterMap();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getProtocol()
- */
- public String getProtocol()
- {
- return delegate.getProtocol();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getScheme()
- */
- public String getScheme()
- {
- return delegate.getScheme();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getServerName()
- */
- public String getServerName()
- {
- return delegate.getServerName();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getServerPort()
- */
- public int getServerPort()
- {
- return delegate.getServerPort();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getReader()
- */
- public BufferedReader getReader() throws IOException
- {
- return delegate.getReader();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRemoteAddr()
- */
- public String getRemoteAddr()
- {
- return delegate.getRemoteAddr();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRemoteHost()
- */
- public String getRemoteHost()
- {
- return delegate.getRemoteHost();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#setAttribute(String, Object)
- */
- public void setAttribute(String name, Object o)
- {
- delegate.setAttribute(name, o);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#removeAttribute(String)
- */
- public void removeAttribute(String name)
- {
- delegate.removeAttribute(name);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getLocale()
- */
- public Locale getLocale()
- {
- return delegate.getLocale();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getLocales()
- */
- public Enumeration getLocales()
- {
- return delegate.getLocales();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#isSecure()
- */
- public boolean isSecure()
- {
- return delegate.isSecure();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRequestDispatcher(String)
- */
- public RequestDispatcher getRequestDispatcher(String path)
- {
- return delegate.getRequestDispatcher(path);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRealPath(String)
- */
- public String getRealPath(String path)
- {
- return delegate.getRealPath(path);
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getRemotePort()
- */
- public int getRemotePort()
- {
- return delegate.getRemotePort();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getLocalName()
- */
- public String getLocalName()
- {
- return delegate.getLocalName();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getLocalAddr()
- */
- public String getLocalAddr()
- {
- return delegate.getLocalAddr();
- }
-
- /**
- * @see javax.servlet.http.HttpServletRequest#getLocalPort()
- */
- public int getLocalPort()
- {
- return delegate.getLocalPort();
- }
-
- /**
- * Get the underlying request - the delegate
- */
- public HttpServletRequest getRequest()
- {
- return delegate;
- }
-}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/HttpRequestWrapper.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/HttpRequestWrapper.java 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/localization/HttpRequestWrapper.java 2010-09-28 16:19:26 UTC (rev 4412)
@@ -24,6 +24,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
import java.util.Collections;
import java.util.Enumeration;
import java.util.LinkedList;
@@ -33,7 +34,7 @@
/**
* @author <a href="mailto:mstrukel@redhat.com">Marko Strukelj</a>
*/
-public class HttpRequestWrapper extends BaseHttpRequestWrapper
+public class HttpRequestWrapper extends HttpServletRequestWrapper
{
private static final List<Locale> EMPTY_LOCALE_LIST = Collections.emptyList();
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/CaptchaValidator.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/CaptchaValidator.java 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/CaptchaValidator.java 2010-09-28 16:19:26 UTC (rev 4412)
@@ -19,9 +19,8 @@
package org.exoplatform.portal.webui;
-import org.exoplatform.portal.application.PortalRequestContext;
-import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.exception.MessageException;
import org.exoplatform.webui.form.UIForm;
@@ -32,8 +31,8 @@
import java.io.Serializable;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
/**
* @author <a href="mailto:theute@redhat.com">Thomas Heute</a>
@@ -46,9 +45,9 @@
public void validate(UIFormInput uiInput) throws Exception
{
- PortalRequestContext prContext = Util.getPortalRequestContext();
- HttpServletRequest request = prContext.getRequest();
- HttpSession session = request.getSession();
+ PortletRequestContext ctx = PortletRequestContext.getCurrentInstance();
+ PortletRequest req = ctx.getRequest();
+ PortletSession session = req.getPortletSession();
Captcha captcha = (Captcha) session.getAttribute(Captcha.NAME);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2010-09-28 13:09:32 UTC (rev 4411)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/UICaptcha.java 2010-09-28 16:19:26 UTC (rev 4412)
@@ -22,11 +22,12 @@
******************************************************************************/
package org.exoplatform.portal.webui;
-import java.util.Calendar;
-
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.form.UIFormStringInput;
+import javax.portlet.RenderResponse;
+import javax.portlet.ResourceURL;
+
/**
* @author <a href="mailto:theute@redhat.com">Thomas Heute</a>
* @version $Revision$
@@ -40,9 +41,18 @@
}
public void processRender(WebuiRequestContext context) throws Exception
- {
- context.getWriter().write("<div id='" + getId() + "'><img src=\"" + context.getPortalContextPath() + "/captcha?v=" +
- Calendar.getInstance().getTimeInMillis() + "\" /><br/>");
+ {
+
+ RenderResponse resp = context.getResponse();
+
+ //
+ ResourceURL url = resp.createResourceURL();
+
+ // context.getPortalContextPath() + "/captcha?v=" + Calendar.getInstance().getTimeInMillis()
+
+
+
+ context.getWriter().write("<div id='" + getId() + "'><img src=\"" + url.toString() + "\" /><br/>");
super.processRender(context);
context.getWriter().write("</div>");
}
14 years, 3 months