gatein SVN: r5219 - components/pc/tags.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-23 07:42:30 -0500 (Tue, 23 Nov 2010)
New Revision: 5219
Added:
components/pc/tags/2.2.0-GA/
Log:
[maven-scm] copy for tag 2.2.0-GA
Copied: components/pc/tags/2.2.0-GA (from rev 5218, components/pc/trunk)
14 years, 1 month
gatein SVN: r5218 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-23 07:41:50 -0500 (Tue, 23 Nov 2010)
New Revision: 5218
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare release 2.2.0-GA
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/api/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/bridge/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/controller/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/docs/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/federation/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/jsr168api/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/management/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/mc/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -29,7 +29,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
<packaging>pom</packaging>
<parent>
@@ -39,9 +39,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.2.0-GA</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.2.0-GA</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.2.0-GA</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/portal/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/portlet/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/samples/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-11-23 12:03:39 UTC (rev 5217)
+++ components/pc/trunk/test/pom.xml 2010-11-23 12:41:50 UTC (rev 5218)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-CR03-SNAPSHOT</version>
+ <version>2.2.0-GA</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
14 years, 1 month
gatein SVN: r5217 - in portal/branches/branch-GTNPORTAL-1643: component/web/resources/src/main/java/org/exoplatform/portal/resource and 2 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-11-23 07:03:39 -0500 (Tue, 23 Nov 2010)
New Revision: 5217
Modified:
portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/Image.java
portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java
portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/CachedStylesheet.java
portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
portal/branches/branch-GTNPORTAL-1643/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java
Log:
GTNPORTAL-1455 CSS file are not cached (in the browser)
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/Image.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/Image.java 2010-11-23 11:40:36 UTC (rev 5216)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/Image.java 2010-11-23 12:03:39 UTC (rev 5217)
@@ -19,6 +19,8 @@
package org.exoplatform.portal.application;
+import java.util.Date;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -29,10 +31,19 @@
final ImageType type;
final byte[] bytes;
+
+ final long lastModified;
public Image(ImageType type, byte[] bytes)
{
this.type = type;
this.bytes = bytes;
+// Remove miliseconds because string of date retrieve from Http header doesn't have miliseconds
+ lastModified = (new Date().getTime() / 1000) * 1000;
}
+
+ public long getLastModified()
+ {
+ return lastModified;
+ }
}
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java 2010-11-23 11:40:36 UTC (rev 5216)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/application/ResourceRequestFilter.java 2010-11-23 12:03:39 UTC (rev 5217)
@@ -36,6 +36,7 @@
import java.io.OutputStream;
import java.net.URLDecoder;
import java.nio.charset.Charset;
+import java.util.Date;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -64,6 +65,10 @@
private ConcurrentMap<String, FutureTask<Image>> mirroredImageCache = new ConcurrentHashMap<String, FutureTask<Image>>();
+ public static final String IF_MODIFIED_SINCE = "If-Modified-Since";
+
+ public static final String LAST_MODIFIED = "Last-Modified";
+
public void afterInit(FilterConfig filterConfig)
{
cfg = filterConfig;
@@ -77,11 +82,19 @@
final String uri = URLDecoder.decode(httpRequest.getRequestURI(), "UTF-8");
final HttpServletResponse httpResponse = (HttpServletResponse)response;
ExoContainer portalContainer = getContainer();
- SkinService skinService = (SkinService)portalContainer.getComponentInstanceOfType(SkinService.class);
+ final SkinService skinService = (SkinService) portalContainer.getComponentInstanceOfType(SkinService.class);
+ long ifModifiedSince = httpRequest.getDateHeader(IF_MODIFIED_SINCE);
//
if (uri.endsWith(".css"))
{
+// Check if cached resource has not been modifed, return 304 code
+ long cssLastModified = skinService.getLastModified(uri);
+ if (isNotModified(ifModifiedSince, cssLastModified)) {
+ httpResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ return;
+ }
+
final OutputStream out = response.getOutputStream();
final BinaryOutput output = new BinaryOutput()
{
@@ -118,6 +131,9 @@
{
httpResponse.setHeader("Cache-Control", "no-cache");
}
+
+ long lastModified = skinService.getLastModified(uri);
+ processIfModified(lastModified, httpResponse);
}
};
@@ -192,8 +208,16 @@
Image img = futureImg.get();
if (img != null)
{
+ //Check if cached resource has not been modifed, return 304 code
+ long imgLastModified = img.getLastModified();
+ if (isNotModified(ifModifiedSince, imgLastModified)) {
+ httpResponse.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ return;
+ }
httpResponse.setContentType(img.type.getMimeType());
httpResponse.setContentLength(img.bytes.length);
+ processIfModified(imgLastModified, httpResponse);
+
OutputStream out = httpResponse.getOutputStream();
out.write(img.bytes);
out.close();
@@ -238,6 +262,30 @@
}
}
+ /**
+ * Add Last-Modified Http header to HttpServetResponse
+ */
+ public void processIfModified(long lastModified, HttpServletResponse httpResponse) {
+ httpResponse.setDateHeader(ResourceRequestFilter.LAST_MODIFIED, lastModified);
+ }
+
+ /**
+ * If cached resource has not changed since date in http header (If_Modified_Since), return true
+ * Else return false;
+ * @param ifModifedSince - String, and HttpHeader element
+ * @param lastModified
+ * @param httpResponse
+ * @return
+ */
+ public boolean isNotModified(long ifModifedSince, long lastModified) {
+ if (!PropertyManager.isDevelopping()) {
+ if (ifModifedSince >= lastModified) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public void destroy()
{
}
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/CachedStylesheet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/CachedStylesheet.java 2010-11-23 11:40:36 UTC (rev 5216)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/CachedStylesheet.java 2010-11-23 12:03:39 UTC (rev 5217)
@@ -24,6 +24,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Date;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -40,6 +41,8 @@
/** . */
private final byte[] bytes;
+
+ private long lastModified;
public CachedStylesheet(String text)
{
@@ -59,11 +62,18 @@
//
this.text = text;
this.bytes = bytes;
+// Remove miliseconds because string of date retrieve from Http header doesn't have miliseconds
+ lastModified = (new Date().getTime() / 1000) * 1000;
}
public String getText()
{
return text;
+ }
+
+ public long getLastModified()
+ {
+ return lastModified;
}
public void writeTo(BinaryOutput output) throws IOException
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-11-23 11:40:36 UTC (rev 5216)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/portal/resource/SkinService.java 2010-11-23 12:03:39 UTC (rev 5217)
@@ -51,6 +51,7 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
+import java.util.Date;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
@@ -455,6 +456,9 @@
// Try cache first
if (!PropertyManager.isDevelopping())
{
+ //
+ FutureExoCache<String, CachedStylesheet, Orientation> cache = orientation == Orientation.LT ? ltCache : rtCache;
+ CachedStylesheet cachedCss = cache.get(orientation, path);
if (path.startsWith("/" + portalContainerName + "/resource"))
{
@@ -464,11 +468,7 @@
{
renderer.setExpiration(ONE_HOUR);
}
-
- //
- FutureExoCache<String, CachedStylesheet, Orientation> cache = orientation == Orientation.LT ? ltCache : rtCache;
- CachedStylesheet cachedCss = cache.get(orientation, path);
-
+
cachedCss.writeTo(renderer.getOutput());
}
else
@@ -546,6 +546,41 @@
}
/**
+ * Return last modifed date of cached css
+ * Return null if cached css can not be found
+ * @param path - path must not be null
+ */
+ public long getLastModified(String path)
+ {
+ if (path == null)
+ {
+ throw new IllegalArgumentException("path must not be null");
+ }
+
+ FutureExoCache<String, CachedStylesheet, Orientation> cache = ltCache;
+ Orientation orientation = Orientation.LT;
+ if (path.endsWith("-lt.css"))
+ {
+ path = path.substring(0, path.length() - "-lt.css".length()) + ".css";
+ }
+ else if (path.endsWith("-rt.css"))
+ {
+ path = path.substring(0, path.length() - "-rt.css".length()) + ".css";
+ orientation = Orientation.RT;
+ }
+
+ CachedStylesheet cachedCSS = cache.get(orientation, path);
+ if (cachedCSS == null)
+ {
+ return Long.MAX_VALUE;
+ }
+ else
+ {
+ return cachedCSS.getLastModified();
+ }
+ }
+
+ /**
* Remove SkinConfig from Portal Skin Configs by module and skin name
* @param module
* @param skinName
Modified: portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2010-11-23 11:40:36 UTC (rev 5216)
+++ portal/branches/branch-GTNPORTAL-1643/component/web/resources/src/main/java/org/exoplatform/web/application/javascript/JavascriptConfigService.java 2010-11-23 12:03:39 UTC (rev 5217)
@@ -40,6 +40,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
+import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@@ -64,6 +65,8 @@
private HashMap<String, String> extendedJavascripts;
private byte[] jsBytes = null;
+
+ private long lastModified = Long.MAX_VALUE;
/** . */
private JavascriptDeployer deployer;
@@ -278,6 +281,18 @@
*/
public void writeMergedJavascript(OutputStream out) throws IOException
{
+ jsBytes = getMergedJavascript();
+
+ //
+ out.write(jsBytes);
+ }
+
+ /**
+ * Return merged javascript in byte array
+ * @return byte[]
+ */
+ public byte[] getMergedJavascript()
+ {
if (jsBytes == null)
{
// Generate javascript in a buffer
@@ -314,10 +329,15 @@
log.error("Error when generating minified javascript, will use normal javascript instead", e);
jsBytes = bytes;
}
+// Remove miliseconds because string of date retrieve from Http header doesn't have miliseconds
+ lastModified = (new Date().getTime() / 1000) * 1000;
}
+ return jsBytes;
+ }
- //
- out.write(jsBytes);
+ public long getLastModified()
+ {
+ return lastModified;
}
/**
@@ -374,4 +394,4 @@
DefaultServletContainerFactory.getInstance().getServletContainer().removeWebAppListener(removal);
}
-}
\ No newline at end of file
+}
Modified: portal/branches/branch-GTNPORTAL-1643/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java
===================================================================
--- portal/branches/branch-GTNPORTAL-1643/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java 2010-11-23 11:40:36 UTC (rev 5216)
+++ portal/branches/branch-GTNPORTAL-1643/webui/portal/src/main/java/org/exoplatform/portal/webui/javascript/JavascriptServlet.java 2010-11-23 12:03:39 UTC (rev 5217)
@@ -19,10 +19,14 @@
package org.exoplatform.portal.webui.javascript;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.portal.application.ResourceRequestFilter;
import org.exoplatform.web.application.javascript.JavascriptConfigService;
import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Date;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
@@ -55,14 +59,23 @@
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException
{
- JavascriptConfigService service =
+ final JavascriptConfigService service =
(JavascriptConfigService)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(
JavascriptConfigService.class);
-
+ long lastModified = service.getLastModified();
+ long ifModifiedSince = request.getDateHeader(ResourceRequestFilter.IF_MODIFIED_SINCE);
+
// Julien: should we also set charset along with the content type ?
response.setContentType("application/x-javascript");
- ServletOutputStream stream = response.getOutputStream();
- service.writeMergedJavascript(stream);
+ if (!PropertyManager.isDevelopping()) {
+ if (ifModifiedSince >= lastModified) {
+ response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ return;
+ }
+ }
+
+ byte[] jsBytes = service.getMergedJavascript();
+ response.setDateHeader(ResourceRequestFilter.LAST_MODIFIED, lastModified);
+ response.getOutputStream().write(jsBytes);
}
-
}
14 years, 1 month
gatein SVN: r5216 - portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-23 06:40:36 -0500 (Tue, 23 Nov 2010)
New Revision: 5216
Modified:
portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
Log:
GTNPORTAL-1676: login page doesn't redirect well
Modified: portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
===================================================================
--- portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-11-23 11:35:32 UTC (rev 5215)
+++ portal/trunk/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-11-23 11:40:36 UTC (rev 5216)
@@ -129,6 +129,11 @@
}
try
{
+ String queryString = (String)req.getAttribute("javax.servlet.forward.query_string");
+ if ((String)req.getAttribute("javax.servlet.forward.query_string") != null)
+ {
+ initialURI = initialURI + "?" + queryString;
+ }
req.setAttribute("org.gatein.portal.login.initial_uri", initialURI);
getServletContext().getRequestDispatcher("/login/jsp/login.jsp").include(req, resp);
}
14 years, 1 month
gatein SVN: r5215 - epp/portal/branches/EPP_5_1_Branch/component/web/security/src/main/java/org/exoplatform/web/login.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-23 06:35:32 -0500 (Tue, 23 Nov 2010)
New Revision: 5215
Modified:
epp/portal/branches/EPP_5_1_Branch/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
Log:
JBEPP-649: Login page doesn't redirect well
Modified: epp/portal/branches/EPP_5_1_Branch/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-11-23 10:42:20 UTC (rev 5214)
+++ epp/portal/branches/EPP_5_1_Branch/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-11-23 11:35:32 UTC (rev 5215)
@@ -129,6 +129,11 @@
}
try
{
+ String queryString = (String)req.getAttribute("javax.servlet.forward.query_string");
+ if ((String)req.getAttribute("javax.servlet.forward.query_string") != null)
+ {
+ initialURI = initialURI + "?" + queryString;
+ }
req.setAttribute("org.gatein.portal.login.initial_uri", initialURI);
getServletContext().getRequestDispatcher("/login/jsp/login.jsp").include(req, resp);
}
14 years, 1 month
gatein SVN: r5214 - portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: bdaw
Date: 2010-11-23 05:42:20 -0500 (Tue, 23 Nov 2010)
New Revision: 5214
Modified:
portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
Log:
GTNPORTAL-1680 StackOverflowError if LDAP groups contain circular cross references
Modified: portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2010-11-23 10:28:11 UTC (rev 5213)
+++ portal/trunk/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2010-11-23 10:42:20 UTC (rev 5214)
@@ -57,6 +57,8 @@
private PicketLinkIDMOrganizationServiceImpl orgService;
+ private static final String CYCLIC_ID = "org.gatein.portal.identity.LOOPED_GROUP_ID";
+
public GroupDAOImpl(PicketLinkIDMOrganizationServiceImpl orgService, PicketLinkIDMService service)
{
service_ = service;
@@ -557,7 +559,7 @@
}
// Resolve full ID
- String id = getGroupId(jbidGroup);
+ String id = getGroupId(jbidGroup, null);
exoGroup.setId(id);
@@ -575,13 +577,27 @@
return exoGroup;
}
- private String getGroupId(org.picketlink.idm.api.Group jbidGroup) throws Exception
+ /**
+ * Calculates group id by checking all parents up to the root group or group type mapping from the configuration.
+ *
+ * @param jbidGroup
+ * @param processed
+ * @return
+ * @throws Exception
+ */
+ private String getGroupId(org.picketlink.idm.api.Group jbidGroup,
+ List<org.picketlink.idm.api.Group> processed) throws Exception
{
if (jbidGroup.equals(getRootGroup()))
{
return "";
}
+ if (processed == null)
+ {
+ processed = new LinkedList<org.picketlink.idm.api.Group>();
+ }
+
Collection<org.picketlink.idm.api.Group> parents = new HashSet();
String gtnGroupName = getGtnGroupName(jbidGroup.getName());
@@ -596,7 +612,13 @@
log.info("Identity operation error: ", e);
}
-
+ // Check if there is cross reference so we ended in a loop and break the process.
+ if (parents.size() > 0 && processed.contains(parents.iterator().next()))
+ {
+ processed.remove(processed.size() - 1);
+ return CYCLIC_ID;
+ }
+ // If there are no parents or more then one parent
if (parents.size() == 0 || parents.size() > 1)
{
@@ -606,34 +628,64 @@
"defined by type mappings or just place it under root /");
}
+ return obtainMappedId(jbidGroup, gtnGroupName);
- String id = orgService.getConfiguration().getParentId(jbidGroup.getGroupType());
+ }
+ processed.add(jbidGroup);
+ String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()),processed);
-
- if (id != null && orgService.getConfiguration().isForceMembershipOfMappedTypes())
+ // Check if loop occured
+ if (parentGroupId.equals(CYCLIC_ID))
+ {
+ // if there are still processed groups in the list we are in nested call so remove last one and go back
+ if (processed.size() > 0)
{
- if (id.endsWith("/*"))
- {
- id = id.substring(0, id.length() - 2);
- }
-
- return id + "/" + gtnGroupName;
+ processed.remove(processed.size() - 1);
+ return parentGroupId;
}
+ // if we finally reached the first group from the looped ones then just return id calculated from
+ // mappings or connect it to the root
+ else
+ {
+ return obtainMappedId(jbidGroup, gtnGroupName);
+ }
+ }
- // All groups not connected to the root should be just below the root
- return "/" + gtnGroupName;
+ return parentGroupId + "/" + gtnGroupName;
- //TODO: make it configurable
- // throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());
+ }
+ /**
+ * Obtain group id based on groupType mapping from configuration or if this fails just place it under root /
+ *
+ * @param jbidGroup
+ * @param gtnGroupName
+ * @return
+ */
+ private String obtainMappedId(org.picketlink.idm.api.Group jbidGroup, String gtnGroupName)
+ {
+ String id = orgService.getConfiguration().getParentId(jbidGroup.getGroupType());
+
+
+
+ if (id != null && orgService.getConfiguration().isForceMembershipOfMappedTypes())
+ {
+ if (id.endsWith("/*"))
+ {
+ id = id.substring(0, id.length() - 2);
+ }
+
+ return id + "/" + gtnGroupName;
}
- String parentGroupId = getGroupId(((org.picketlink.idm.api.Group)parents.iterator().next()));
- return parentGroupId + "/" + gtnGroupName;
+ // All groups not connected to the root should be just below the root
+ return "/" + gtnGroupName;
+ //TODO: make it configurable
+ // throw new IllegalStateException("Group present that is not connected to the root: " + jbidGroup.getName());
}
private org.picketlink.idm.api.Group persistGroup(Group exoGroup) throws Exception
14 years, 1 month
gatein SVN: r5213 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-11-23 05:28:11 -0500 (Tue, 23 Nov 2010)
New Revision: 5213
Added:
portal/trunk/testsuite/testdefinitions/eXo_RegressTest_GateIn_3.2.x_TestDefinition.ods
Log:
TESTVN-2053 - Verify Normalization and completeness of TestDefinitions for GateIn product in trunk
Added: portal/trunk/testsuite/testdefinitions/eXo_RegressTest_GateIn_3.2.x_TestDefinition.ods
===================================================================
(Binary files differ)
Property changes on: portal/trunk/testsuite/testdefinitions/eXo_RegressTest_GateIn_3.2.x_TestDefinition.ods
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 1 month
gatein SVN: r5212 - epp/portal/branches/EPP_5_1_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2010-11-23 02:51:05 -0500 (Tue, 23 Nov 2010)
New Revision: 5212
Modified:
epp/portal/branches/EPP_5_1_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
Log:
JBEPP-636: NullPointerException with LDAP in GroupDAOImpl.findGroups
Modified: epp/portal/branches/EPP_5_1_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2010-11-23 07:35:23 UTC (rev 5211)
+++ epp/portal/branches/EPP_5_1_Branch/component/identity/src/main/java/org/exoplatform/services/organization/idm/GroupDAOImpl.java 2010-11-23 07:51:05 UTC (rev 5212)
@@ -370,7 +370,8 @@
{
String id = g.getParentId();
if ((parent == null && id == null)
- || (id != null && id.equals(parent.getId())))
+ || (parent != null && id != null && id.equals(parent.getId()))
+ || (parent == null && id != null && id.equals("/")))
{
exoGroups.add(g);
continue;
14 years, 1 month
gatein SVN: r5211 - in exo/portal/branches/3.1.x/component/resources/src: test/java/locale and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-11-23 02:35:23 -0500 (Tue, 23 Nov 2010)
New Revision: 5211
Added:
exo/portal/branches/3.1.x/component/resources/src/test/java/locale/portlet_en.properties
Modified:
exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
exo/portal/branches/3.1.x/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
Log:
EXOGTN-131: Apply ECM-validated patch and JUnit test
Modified: exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java
===================================================================
--- exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-23 04:07:49 UTC (rev 5210)
+++ exo/portal/branches/3.1.x/component/resources/src/main/java/org/exoplatform/services/resources/impl/BaseResourceBundleService.java 2010-11-23 07:35:23 UTC (rev 5211)
@@ -22,6 +22,7 @@
import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.commons.utils.MapResourceBundle;
import org.exoplatform.commons.utils.PageList;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.services.cache.ExoCache;
import org.exoplatform.services.log.Log;
@@ -42,12 +43,10 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.Set;
/**
* Created by The eXo Platform SAS Mar 9, 2007
@@ -383,11 +382,6 @@
return IdentityResourceBundle.getInstance();
}
- // Case 1: ResourceBundle of portlets, standard java API is used
- if (isClasspathResource(name))
- return ResourceBundleLoader.load(name, locale, cl);
-
- // Case 2: ResourceBundle of portal
String country = locale.getCountry();
String id;
if (country != null && country.length() > 0)
@@ -399,18 +393,39 @@
id = name + "_" + locale.getLanguage();
}
- try
+ boolean isClasspathResource = isClasspathResource(name);
+ boolean isCacheable = !isClasspathResource || !PropertyManager.isDevelopping();
+ if (isCacheable)
{
- ResourceBundle rb = cache_.get(id);
- if (rb != null)
+ if (isClasspathResource)
{
- return rb;
+ // Avoid naming collision
+ id += "_" + cl.getClass() + "_" + cl.hashCode();
}
+ try
+ {
+ ResourceBundle rb = cache_.get(id);
+ if (rb != null)
+ {
+ return rb;
+ }
+ }
+ catch (Exception ex)
+ {
+ }
}
- catch (Exception ex)
+
+ // Case 1: ResourceBundle of portlets, standard java API is used
+ if (isClasspathResource)
{
+ ResourceBundle res = ResourceBundleLoader.load(name, locale, cl);
+ //Cache classpath resource bundle while running portal in non-dev mode
+ if (isCacheable)
+ cache_.put(id, res);
+ return res;
}
+ // Case 2: ResourceBundle of portal
try
{
ResourceBundle res = null;
Added: exo/portal/branches/3.1.x/component/resources/src/test/java/locale/portlet_en.properties
===================================================================
--- exo/portal/branches/3.1.x/component/resources/src/test/java/locale/portlet_en.properties (rev 0)
+++ exo/portal/branches/3.1.x/component/resources/src/test/java/locale/portlet_en.properties 2010-11-23 07:35:23 UTC (rev 5211)
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2009 eXo Platform SAS.
+#
+# This is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# This software is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this software; if not, write to the Free
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+#
+
+language.language=English
Modified: exo/portal/branches/3.1.x/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java
===================================================================
--- exo/portal/branches/3.1.x/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-11-23 04:07:49 UTC (rev 5210)
+++ exo/portal/branches/3.1.x/component/resources/src/test/java/org/exoplatform/services/resources/test/TestResourceBundleService.java 2010-11-23 07:35:23 UTC (rev 5211)
@@ -19,8 +19,13 @@
package org.exoplatform.services.resources.test;
+import org.exoplatform.commons.utils.PropertyManager;
import org.exoplatform.container.PortalContainer;
-import org.exoplatform.services.resources.*;
+import org.exoplatform.services.resources.AbstractResourceBundleTest;
+import org.exoplatform.services.resources.LocaleConfigService;
+import org.exoplatform.services.resources.Query;
+import org.exoplatform.services.resources.ResourceBundleData;
+import org.exoplatform.services.resources.ResourceBundleService;
import java.util.List;
import java.util.Locale;
@@ -178,4 +183,33 @@
{
return "Test Resource Bundle Service";
}
+
+ public void testClasspathResourceCache()
+ {
+ String oldValue = PropertyManager.getProperty(PropertyManager.DEVELOPING);
+ try
+ {
+ PropertyManager.setProperty(PropertyManager.DEVELOPING, "false");
+ assertFalse(PropertyManager.isDevelopping());
+ MyClassLoader cl1 = new MyClassLoader();
+ ResourceBundle res = service_.getResourceBundle("locale.portlet", Locale.ENGLISH, cl1);
+ assertNotNull(res);
+ assertTrue(res == service_.getResourceBundle("locale.portlet", Locale.ENGLISH, cl1));
+ assertFalse(res == service_.getResourceBundle("locale.portlet", Locale.ENGLISH, new MyClassLoader()));
+ }
+ finally
+ {
+ PropertyManager.setProperty(PropertyManager.DEVELOPING, oldValue);
+ }
+ }
+
+ private static class MyClassLoader extends ClassLoader
+ {
+
+ @Override
+ public String toString()
+ {
+ return "MyClassLoader";
+ }
+ }
}
14 years, 1 month
gatein SVN: r5210 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-11-22 23:07:49 -0500 (Mon, 22 Nov 2010)
New Revision: 5210
Removed:
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_BasicPortlets_TestDefinition.ods
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_MainFucntions_TestDefinition.ods
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_MainFunctions_TestDefinition.ods
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SmokeTests_TestDefinition.ods
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_TechTests_TestDefinition.ods
portal/trunk/testsuite/testdefinitions/eXo_SniffTest_GateIn_3.1.0_TestDefinition.ods
Log:
TESTVN-321 : delete old versions
Deleted: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_BasicPortlets_TestDefinition.ods
===================================================================
(Binary files differ)
Deleted: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_MainFucntions_TestDefinition.ods
===================================================================
(Binary files differ)
Deleted: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_MainFunctions_TestDefinition.ods
===================================================================
(Binary files differ)
Deleted: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SmokeTests_TestDefinition.ods
===================================================================
(Binary files differ)
Deleted: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_SniffTests.ods
===================================================================
(Binary files differ)
Deleted: portal/trunk/testsuite/testdefinitions/GateIn_v3.1.0_TechTests_TestDefinition.ods
===================================================================
(Binary files differ)
Deleted: portal/trunk/testsuite/testdefinitions/eXo_SniffTest_GateIn_3.1.0_TestDefinition.ods
===================================================================
(Binary files differ)
14 years, 1 month