Author: hfnukal
Date: 2011-08-09 19:32:42 -0400 (Tue, 09 Aug 2011)
New Revision: 7035
Added:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ClosureCompressorPlugin.java
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/pom.xml
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/BaseResourceCompressorPlugin.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ResourceCompressorService.java
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/compressor/TestResourceCompressorService.java
epp/portal/branches/EPP_5_2_Branch/pom.xml
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/resource-compressor-configuration.xml
Log:
JBEPP-763 Javascript not working with exo product developing=false
Modified: epp/portal/branches/EPP_5_2_Branch/component/web/resources/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/web/resources/pom.xml 2011-08-09 19:16:03
UTC (rev 7034)
+++ epp/portal/branches/EPP_5_2_Branch/component/web/resources/pom.xml 2011-08-09 23:32:42
UTC (rev 7035)
@@ -49,6 +49,10 @@
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.javascript</groupId>
+ <artifactId>closure-compiler</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component.test.core</artifactId>
<scope>test</scope>
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/BaseResourceCompressorPlugin.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/BaseResourceCompressorPlugin.java 2011-08-09
19:16:03 UTC (rev 7034)
+++
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/BaseResourceCompressorPlugin.java 2011-08-09
23:32:42 UTC (rev 7035)
@@ -17,35 +17,55 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
package org.exoplatform.portal.resource.compressor;
-
+
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.ValueParam;
-
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
+import org.exoplatform.management.jmx.annotations.Property;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang
TO</a>
* Aug 19, 2010
*/
-
+@Managed
+@ManagedDescription("A resource compressor plugin")
+@NameTemplate({@Property(key = "service", value = "resource"),
@Property(key = "compressor", value = "{Name}")})
public abstract class BaseResourceCompressorPlugin extends BaseComponentPlugin implements
ResourceCompressorPlugin
{
- private int priority;
-
- public BaseResourceCompressorPlugin(InitParams params)
- {
- ValueParam priorityParam = params.getValueParam("plugin.priority");
- try
- {
- this.priority = Integer.parseInt(priorityParam.getValue());
- }
- catch (NumberFormatException NBFEx)
- {
- this.priority = -1;
- }
- }
-
- public int getPriority()
- {
- return priority;
- }
-}
+
+ private int priority;
+
+ protected final Logger log = LoggerFactory.getLogger(getClass());
+
+ public BaseResourceCompressorPlugin(InitParams params)
+ {
+ ValueParam priorityParam = params.getValueParam("plugin.priority");
+ try
+ {
+ this.priority = Integer.parseInt(priorityParam.getValue());
+ }
+ catch (NumberFormatException NBFEx)
+ {
+ this.priority = -1;
+ }
+ }
+
+ @Managed
+ @ManagedDescription("The plugin priority")
+ public int getPriority()
+ {
+ return priority;
+ }
+
+ @Managed
+ @ManagedDescription("The plugin type")
+ public String getType()
+ {
+ return getResourceType().name();
+ }
+}
\ No newline at end of file
Added:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ClosureCompressorPlugin.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ClosureCompressorPlugin.java
(rev 0)
+++
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ClosureCompressorPlugin.java 2011-08-09
23:32:42 UTC (rev 7035)
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2011 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.portal.resource.compressor.impl;
+
+import com.google.javascript.jscomp.CompilationLevel;
+import com.google.javascript.jscomp.Compiler;
+import com.google.javascript.jscomp.CompilerOptions;
+import com.google.javascript.jscomp.JSSourceFile;
+import com.google.javascript.jscomp.WarningLevel;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.portal.resource.compressor.BaseResourceCompressorPlugin;
+import org.exoplatform.portal.resource.compressor.ResourceCompressorException;
+import org.exoplatform.portal.resource.compressor.ResourceType;
+import java.io.Reader;
+import java.io.Writer;
+
+/**
+ * A compressor based on the Google <a
href="http://code.google.com/closure/>Closure Tools</a> javascript
compiler.
+ * This plugin compresses javascript resources and provides three levels of compression,
configured
+ * via the <code>level</code> init param:
+ * <ul>
+ * <li><code>basic</code> encodes with the
<code>WHITESPACE_ONLY</code> Closure level</li>
+ * <li><code>simple</code> encodes with the
<code>SIMPLE_OPTIMIZATIONS</code> Closure level</li>
+ * <li><code>advanced</code> encodes with the
<code>ADVANCED_OPTIMIZATIONS</code> Closure level</li>
+ * </ul>
+ * The precise meaning of the Closure levels are described on
+ * <a
href="http://code.google.com/closure/compiler/docs/compilation_level...
page</a>.
+ */
+public class ClosureCompressorPlugin extends BaseResourceCompressorPlugin
+{
+
+ /** . */
+ private volatile CompilationLevel compilationLevel;
+
+ public ClosureCompressorPlugin(InitParams params) throws Exception
+ {
+ super(params);
+
+ //
+ ValueParam vp = params.getValueParam("level");
+ CompilationLevel level = null;
+ if (vp != null)
+ {
+ String value = vp.getValue().trim().toLowerCase();
+ log.debug("found compressor level configuration " + value);
+ setLevel(value);
+ }
+
+ //
+ if (level == null)
+ {
+ log.debug("no compressor level found, will use simple level
instead");
+ level = CompilationLevel.SIMPLE_OPTIMIZATIONS;
+ }
+
+ //
+ this.compilationLevel = level;
+ }
+
+ @Managed
+ @ManagedDescription("The compression level value among
{basic,simple,advanced}")
+ public String getLevel()
+ {
+ if (compilationLevel == CompilationLevel.WHITESPACE_ONLY)
+ {
+ return "basic";
+ }
+ else if (compilationLevel == CompilationLevel.ADVANCED_OPTIMIZATIONS)
+ {
+ return "advanced";
+ }
+ else
+ {
+ return "simple";
+ }
+ }
+
+ @Managed
+ public void setLevel(String level)
+ {
+ if (level != null)
+ {
+ level = level.trim().toLowerCase();
+ if ("basic".equals(level))
+ {
+ log.debug("configuring to basic level configuration");
+ compilationLevel = CompilationLevel.WHITESPACE_ONLY;
+ }
+ else if ("simple".equals(level))
+ {
+ log.debug("configuring to simple level configuration");
+ compilationLevel = CompilationLevel.SIMPLE_OPTIMIZATIONS;
+ }
+ else if ("advanced".equals(level))
+ {
+ log.debug("configuring to advanced level configuration");
+ compilationLevel = CompilationLevel.ADVANCED_OPTIMIZATIONS;
+ }
+ }
+ }
+
+ public ResourceType getResourceType()
+ {
+ return ResourceType.JAVASCRIPT;
+ }
+
+ public void compress(Reader input, Writer output) throws ResourceCompressorException
+ {
+ CompilationLevel level = compilationLevel;
+ if (level == null)
+ {
+ level = CompilationLevel.SIMPLE_OPTIMIZATIONS;
+ }
+
+ //
+ Compiler compiler = new Compiler();
+ CompilerOptions options = new CompilerOptions();
+ level.setOptionsForCompilationLevel(options);
+ WarningLevel.QUIET.setOptionsForWarningLevel(options);
+ JSSourceFile extern = JSSourceFile.fromCode("extern", "");
+
+ //
+ JSSourceFile jsInput;
+ try
+ {
+ String code = JSSourceFile.fromReader("code", input).getCode();
+ jsInput = JSSourceFile.fromCode("jsInput", code);
+ compiler.compile(extern, jsInput, options);
+ output.write(compiler.toSource());
+ }
+ catch (Exception ex)
+ {
+ throw new ResourceCompressorException(ex);
+ }
+ }
+}
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ResourceCompressorService.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ResourceCompressorService.java 2011-08-09
19:16:03 UTC (rev 7034)
+++
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/main/java/org/exoplatform/portal/resource/compressor/impl/ResourceCompressorService.java 2011-08-09
23:32:42 UTC (rev 7035)
@@ -17,7 +17,7 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
package org.exoplatform.portal.resource.compressor.impl;
-
+
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
@@ -25,112 +25,139 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-
+
import org.exoplatform.container.component.ComponentPlugin;
import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.management.ManagementAware;
+import org.exoplatform.management.ManagementContext;
+import org.exoplatform.management.annotations.Managed;
+import org.exoplatform.management.annotations.ManagedDescription;
+import org.exoplatform.management.jmx.annotations.NameTemplate;
+import org.exoplatform.management.jmx.annotations.Property;
import org.exoplatform.portal.resource.compressor.ResourceCompressor;
import org.exoplatform.portal.resource.compressor.ResourceCompressorException;
import org.exoplatform.portal.resource.compressor.ResourceCompressorPlugin;
import org.exoplatform.portal.resource.compressor.ResourceType;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-
+
/**
* @author <a href="mailto:hoang281283@gmail.com">Minh Hoang
TO</a>
* Aug 19, 2010
*/
-
-public class ResourceCompressorService implements ResourceCompressor
+@Managed
+@ManagedDescription("The resource compressor service")
+@NameTemplate({@Property(key = "service", value = "resource")})
+public class ResourceCompressorService implements ResourceCompressor, ManagementAware
{
-
- private Log log = ExoLogger.getLogger(ResourceCompressorService.class);
-
- private Map<ResourceType, List<ResourceCompressorPlugin>> plugins;
-
- public ResourceCompressorService(InitParams params) throws Exception
- {
-
- plugins = new HashMap<ResourceType, List<ResourceCompressorPlugin>>();
- }
-
- public void registerCompressorPlugin(ComponentPlugin plugin)
- {
- if (plugin instanceof ResourceCompressorPlugin)
- {
- ResourceCompressorPlugin compressorPlugin = (ResourceCompressorPlugin)plugin;
- ResourceType type = compressorPlugin.getResourceType();
- List<ResourceCompressorPlugin> sameResourceTypePlugins =
plugins.get(type);
-
- if (sameResourceTypePlugins != null)
- {
- sameResourceTypePlugins.add(compressorPlugin);
- log.debug("Loaded compressor plugin: " + compressorPlugin.getName()
+ " for resource type "
- + type.toString());
- }
- else
- {
- List<ResourceCompressorPlugin> newListOfPlugins = new
ArrayList<ResourceCompressorPlugin>();
- newListOfPlugins.add(compressorPlugin);
- log.debug("Loaded compressor plugin: " + compressorPlugin.getName()
+ " for new resource type "
- + type.toString());
- plugins.put(type, newListOfPlugins);
- }
- }
- }
-
- public ResourceCompressorPlugin getCompressorPlugin(ResourceType type, String name)
- {
- List<ResourceCompressorPlugin> sameResourceTypePlugins = plugins.get(type);
-
- if (sameResourceTypePlugins != null)
- {
- for (ResourceCompressorPlugin plugin : sameResourceTypePlugins)
- {
- if (plugin.getName().equals(name))
- {
- return plugin;
- }
- }
- }
- return null;
- }
-
- final public void compress(Reader input, Writer output, ResourceType resourceType)
- throws ResourceCompressorException, IOException
- {
- ResourceCompressorPlugin plugin =
getHighestPriorityCompressorPlugin(resourceType);
- if (plugin != null)
- {
- plugin.compress(input, output);
- }
- else
- {
- throw new ResourceCompressorException("There is no compressor for " +
resourceType + " type");
- }
- }
-
- public ResourceCompressorPlugin getHighestPriorityCompressorPlugin(ResourceType
resourceType)
- {
- List<ResourceCompressorPlugin> candidates = plugins.get(resourceType);
- if (candidates == null || candidates.size() == 0)
- {
- return null;
- }
-
- //Loop the list instead of invoking sort method
- int highestPriorityIndex = 0;
- int maxPriority = -1;
-
- for (int i = 0; i < candidates.size(); i++)
- {
- int currentPriority = candidates.get(i).getPriority();
- if (currentPriority > maxPriority)
- {
- highestPriorityIndex = i;
- maxPriority = currentPriority;
- }
- }
-
- return candidates.get(highestPriorityIndex);
- }
-}
+
+ /** . */
+ private Log log = ExoLogger.getLogger(ResourceCompressorService.class);
+
+ /** . */
+ private Map<ResourceType, List<ResourceCompressorPlugin>> plugins;
+
+ /** . */
+ private ManagementContext managementContext;
+
+ public ResourceCompressorService(InitParams params) throws Exception
+ {
+
+ plugins = new HashMap<ResourceType, List<ResourceCompressorPlugin>>();
+ }
+
+ public void registerCompressorPlugin(ComponentPlugin plugin)
+ {
+ if (plugin instanceof ResourceCompressorPlugin)
+ {
+ ResourceCompressorPlugin compressorPlugin = (ResourceCompressorPlugin)plugin;
+ ResourceType type = compressorPlugin.getResourceType();
+ List<ResourceCompressorPlugin> sameResourceTypePlugins =
plugins.get(type);
+
+ if (sameResourceTypePlugins != null)
+ {
+ sameResourceTypePlugins.add(compressorPlugin);
+ log.debug("Loaded compressor plugin: " + compressorPlugin.getName()
+ " for resource type "
+ + type.toString());
+ }
+ else
+ {
+ List<ResourceCompressorPlugin> newListOfPlugins = new
ArrayList<ResourceCompressorPlugin>();
+ newListOfPlugins.add(compressorPlugin);
+ log.debug("Loaded compressor plugin: " + compressorPlugin.getName()
+ " for new resource type "
+ + type.toString());
+ plugins.put(type, newListOfPlugins);
+ }
+ }
+ }
+
+ public ResourceCompressorPlugin getCompressorPlugin(ResourceType type, String name)
+ {
+ List<ResourceCompressorPlugin> sameResourceTypePlugins = plugins.get(type);
+
+ if (sameResourceTypePlugins != null)
+ {
+ for (ResourceCompressorPlugin plugin : sameResourceTypePlugins)
+ {
+ if (plugin.getName().equals(name))
+ {
+ return plugin;
+ }
+ }
+ }
+ return null;
+ }
+
+ final public void compress(Reader input, Writer output, ResourceType resourceType)
+ throws ResourceCompressorException, IOException
+ {
+ ResourceCompressorPlugin plugin = getHighestPriorityCompressorPlugin(resourceType);
+ if (plugin != null)
+ {
+ plugin.compress(input, output);
+ }
+ else
+ {
+ throw new ResourceCompressorException("There is no compressor for " +
resourceType + " type");
+ }
+ }
+
+ public ResourceCompressorPlugin getHighestPriorityCompressorPlugin(ResourceType
resourceType)
+ {
+ List<ResourceCompressorPlugin> candidates = plugins.get(resourceType);
+ if (candidates == null || candidates.size() == 0)
+ {
+ return null;
+ }
+
+ //Loop the list instead of invoking sort method
+ int highestPriorityIndex = 0;
+ int maxPriority = -1;
+
+ for (int i = 0; i < candidates.size(); i++)
+ {
+ int currentPriority = candidates.get(i).getPriority();
+ if (currentPriority > maxPriority)
+ {
+ highestPriorityIndex = i;
+ maxPriority = currentPriority;
+ }
+ }
+
+ return candidates.get(highestPriorityIndex);
+ }
+
+ public void setContext(ManagementContext context)
+ {
+ this.managementContext = context;
+
+ //
+ for (Map.Entry<ResourceType, List<ResourceCompressorPlugin>> entry :
plugins.entrySet())
+ {
+ for (ResourceCompressorPlugin plugin : entry.getValue())
+ {
+ context.register(plugin);
+ }
+ }
+ }
+}
\ No newline at end of file
Modified:
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/compressor/TestResourceCompressorService.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/compressor/TestResourceCompressorService.java 2011-08-09
19:16:03 UTC (rev 7034)
+++
epp/portal/branches/EPP_5_2_Branch/component/web/resources/src/test/java/org/exoplatform/portal/resource/compressor/TestResourceCompressorService.java 2011-08-09
23:32:42 UTC (rev 7035)
@@ -18,19 +18,32 @@
*/
package org.exoplatform.portal.resource.compressor;
+import com.google.javascript.jscomp.*;
+import com.google.javascript.jscomp.Compiler;
+import org.apache.commons.io.IOUtils;
+import org.exoplatform.commons.utils.IOUtil;
import org.exoplatform.component.test.AbstractKernelTest;
import org.exoplatform.component.test.ConfigurationUnit;
import org.exoplatform.component.test.ConfiguredBy;
import org.exoplatform.component.test.ContainerScope;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.Parameter;
+import org.exoplatform.container.xml.ValueParam;
+import org.exoplatform.portal.resource.compressor.impl.ClosureCompressorPlugin;
import org.exoplatform.portal.resource.compressor.impl.JSMinCompressorPlugin;
import org.exoplatform.portal.resource.compressor.impl.ResourceCompressorService;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStreamReader;
import java.io.Reader;
import java.io.Writer;
+import java.util.Scanner;
/**
* @author <a href="trong.tran(a)exoplatform.com">Trong Tran</a>
@@ -85,6 +98,66 @@
+ jsCompressedFile.getAbsolutePath() + " (" +
getFileSize(jsCompressedFile) + ")");
}
+ public void testClosureCompressing() throws Exception
+ {
+ File jsFile = new File("src/test/resources/javascript.js");
+ File jsCompressedFile = new File("target/closure-compressed-file.js");
+ Reader reader = new FileReader(jsFile);
+ Writer writer = new FileWriter(jsCompressedFile);
+
+ ResourceCompressorService compressor =
+
(ResourceCompressorService)getContainer().getComponentInstanceOfType(ResourceCompressor.class);
+
+ InitParams priorityParam = new InitParams();
+ ValueParam param = new ValueParam();
+ param.setName("plugin.priority");
+ param.setValue("10");
+ priorityParam.addParameter(param);
+ compressor.registerCompressorPlugin(new ClosureCompressorPlugin(priorityParam));
+ try
+ {
+ compressor.compress(reader, writer, ResourceType.JAVASCRIPT);
+ }
+ catch (Exception e)
+ {
+ fail(e.getLocalizedMessage());
+ }
+ finally
+ {
+ reader.close();
+ writer.close();
+ }
+
+ assertTrue(jsCompressedFile.length() > 0);
+ assertTrue(jsFile.length() > jsCompressedFile.length());
+ log.info("The original javascript (" + getFileSize(jsFile) + ") is
compressed by CLOSURE COMPILER into "
+ + jsCompressedFile.getAbsolutePath() + " (" +
getFileSize(jsCompressedFile) + ")");
+
+ String expectedJS = closureCompress(jsFile);
+ assertEquals(expectedJS.length(), jsCompressedFile.length());
+ }
+
+ private String closureCompress(File input) throws Exception
+ {
+ Compiler compiler = new Compiler();
+ CompilerOptions options = new CompilerOptions();
+ CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
+ JSSourceFile extern = JSSourceFile.fromCode("", "");
+
+ JSSourceFile jsInput;
+ try
+ {
+ jsInput = JSSourceFile.fromFile(input);
+ }
+ catch (Exception ex)
+ {
+ throw new ResourceCompressorException(ex);
+ }
+
+ compiler.compile(extern, jsInput, options);
+ return compiler.toSource();
+ }
+
public void testYUICSSCompressing() throws IOException
{
File cssFile = new File("src/test/resources/Stylesheet.css");
Modified: epp/portal/branches/EPP_5_2_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-08-09 19:16:03 UTC (rev 7034)
+++ epp/portal/branches/EPP_5_2_Branch/pom.xml 2011-08-09 23:32:42 UTC (rev 7035)
@@ -75,7 +75,7 @@
<modules>
<module>component</module>
- <!--<module>gadgets</module>-->
+ <module>gadgets</module>
<module>webui</module>
<module>portlet</module>
<module>web</module>
@@ -91,6 +91,17 @@
<dependencyManagement>
<dependencies>
+ <!-- Needed becuase of a Maven bug. Components depend on gatein-dep and for
some
+ reasons with Maven 2.2.1 it can't find that dependency anymore
+ -->
+ <dependency>
+ <groupId>org.gatein</groupId>
+ <artifactId>gatein-dep</artifactId>
+ <version>1.1.0-Beta04</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
<!-- eXo JCR stack -->
<dependency>
<groupId>org.exoplatform.kernel</groupId>
@@ -854,6 +865,12 @@
</dependency>
<dependency>
+ <groupId>com.google.javascript</groupId>
+ <artifactId>closure-compiler</artifactId>
+ <version>r706</version>
+ </dependency>
+
+ <dependency>
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-gadgets</artifactId>
<version>${org.shindig.version}</version>
@@ -908,7 +925,7 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+
<build>
<resources>
<resource>
Modified:
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/resource-compressor-configuration.xml
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/resource-compressor-configuration.xml 2011-08-09
19:16:03 UTC (rev 7034)
+++
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/conf/common/resource-compressor-configuration.xml 2011-08-09
23:32:42 UTC (rev 7035)
@@ -27,6 +27,7 @@
<key>org.exoplatform.portal.resource.compressor.ResourceCompressor</key>
<type>org.exoplatform.portal.resource.compressor.impl.ResourceCompressorService</type>
<component-plugins>
+ <!--
<component-plugin>
<name>JSMinCompressorPlugin</name>
<set-method>registerCompressorPlugin</set-method>
@@ -38,14 +39,26 @@
</value-param>
</init-params>
</component-plugin>
+ -->
<component-plugin>
+ <name>ClosureCompressorPlugin</name>
+ <set-method>registerCompressorPlugin</set-method>
+
<type>org.exoplatform.portal.resource.compressor.impl.ClosureCompressorPlugin</type>
+ <init-params>
+ <value-param>
+ <name>plugin.priority</name>
+ <value>1</value>
+ </value-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
<name>YUICSSCompressorPlugin</name>
<set-method>registerCompressorPlugin</set-method>
<type>org.exoplatform.portal.resource.compressor.css.YUICSSCompressorPlugin</type>
<init-params>
<value-param>
<name>plugin.priority</name>
- <value>1</value>
+ <value>2</value>
</value-param>
</init-params>
</component-plugin>