From: <fg...@us...> - 2010-04-03 13:13:51
|
Revision: 2248 http://openutils.svn.sourceforge.net/openutils/?rev=2248&view=rev Author: fgiust Date: 2010-04-03 13:13:44 +0000 (Sat, 03 Apr 2010) Log Message: ----------- cleaning up Removed Paths: ------------- trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filters/ClientHeadersFilter.java Property Changed: ---------------- trunk/openutils-mgnlcache/ Property changes on: trunk/openutils-mgnlcache ___________________________________________________________________ Added: svn:ignore + .settings target .checkstyle .classpath .project Deleted: trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filters/ClientHeadersFilter.java =================================================================== --- trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filters/ClientHeadersFilter.java 2010-04-03 13:06:23 UTC (rev 2247) +++ trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/filters/ClientHeadersFilter.java 2010-04-03 13:13:44 UTC (rev 2248) @@ -1,119 +0,0 @@ -/** - * - * Magnolia Simplecache module (http://www.openmindlab.com/lab/products/simplecache.html) - * Copyright(C) 2010-2010, Openmind S.r.l. http://www.openmindonline.it - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -package net.sourceforge.openutils.mgnlsimplecache.filters; - -import info.magnolia.cms.filters.AbstractMgnlFilter; - -import java.io.IOException; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - - -/** - * THIS HAS NOTHING TO DO WITH SERVER SIDE CACHE: should not be here but since the original filter has been moved to the - * magnolia cache module I am adding it back here. - * <p> - * Filter that sets cache headers, allowing or dening cache at client-side. By default the filter adds the - * "Cache-Control: public" and expire directives to resources so that everything can be cached by the browser. Setting - * the <code>nocache</code> property to <code>true</code> has the opposite effect, forcing browsers to avoid caching. - * </p> - * <p> - * The following example shows how to configure the filter so that static resources (images, css, js) gets cached by the - * browser, and deny cache for html pages. - * </p> - * - * <pre> - * + server - * + filters - * + ... - * + headers-cache - * - class info.magnolia.module.cache.filter.CacheHeadersFilter - * - expirationMinutes 1440 <em>(default)</em> - * + bypasses - * + extensions - * - class info.magnolia.voting.voters.ExtensionVoter - * - allow gif,jpg,png,swf,css,js - * - not true - * + headers-nocache - * - class info.magnolia.module.cache.filter.CacheHeadersFilter - * - nocache true - * + bypasses - * + extensions - * - class info.magnolia.voting.voters.ExtensionVoter - * - allow html - * - not true - * </pre> - * @author Fabrizio Giustina - * @version $Id$ - */ -public class ClientHeadersFilter extends AbstractMgnlFilter -{ - - /** - * Number of minutes this item must be kept in cache. - */ - private long expirationMinutes = 1440; - - /** - * Cache should be avoided for filtered items. - */ - private boolean nocache; - - /** - * Sets the expirationMinutes. - * @param expirationMinutes the expirationMinutes to set - */ - public void setExpirationMinutes(long expirationMinutes) - { - this.expirationMinutes = expirationMinutes; - } - - /** - * Sets the nocache. - * @param nocache the nocache to set - */ - public void setNocache(boolean nocache) - { - this.nocache = nocache; - } - - public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) - throws IOException, ServletException - { - if (nocache) - { - response.setHeader("Pragma", "no-cache"); - response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0"); - response.setDateHeader("Expires", 0L); - } - else - { - response.setHeader("Pragma", ""); - response.setHeader("Cache-Control", "max-age=" + expirationMinutes * 60 + ", public"); - final long expiration = System.currentTimeMillis() + expirationMinutes * 60000; - response.setDateHeader("Expires", expiration); - } - - chain.doFilter(request, response); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fg...@us...> - 2011-04-27 12:41:26
|
Revision: 3430 http://openutils.svn.sourceforge.net/openutils/?rev=3430&view=rev Author: fgiust Date: 2011-04-27 12:41:15 +0000 (Wed, 27 Apr 2011) Log Message: ----------- CACHE-2 sample cache configuration Modified Paths: -------------- trunk/openutils-mgnlcache/pom.xml trunk/openutils-mgnlcache/src/main/resources/META-INF/magnolia/simplecache.xml Added Paths: ----------- trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/module/ trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/module/SimplecacheModuleVersionHandler.java trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/ trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/simplecache-nooverwrite/ trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/simplecache-nooverwrite/config.server.filters.simplecache.xml Modified: trunk/openutils-mgnlcache/pom.xml =================================================================== --- trunk/openutils-mgnlcache/pom.xml 2011-04-27 12:28:50 UTC (rev 3429) +++ trunk/openutils-mgnlcache/pom.xml 2011-04-27 12:41:15 UTC (rev 3430) @@ -1,4 +1,5 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-parent</artifactId> @@ -58,6 +59,11 @@ <version>1.0</version> </dependency> <dependency> + <groupId>net.sourceforge.openutils</groupId> + <artifactId>openutils-mgnltasks</artifactId> + <version>4.1.2</version> + </dependency> + <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>5.10</version> @@ -75,4 +81,4 @@ <properties> <magnolia.version>4.4.1</magnolia.version> </properties> -</project> +</project> \ No newline at end of file Added: trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/module/SimplecacheModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/module/SimplecacheModuleVersionHandler.java (rev 0) +++ trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/module/SimplecacheModuleVersionHandler.java 2011-04-27 12:41:15 UTC (rev 3430) @@ -0,0 +1,31 @@ +/** + * + * Simplecache module for Magnolia CMS (http://www.openmindlab.com/lab/products/simplecache.html) + * Copyright(C) 2010-2011, Openmind S.r.l. http://www.openmindonline.it + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +package net.sourceforge.openutils.mgnlsimplecache.module; + +import it.openutils.mgnltasks.DiffSimpleModuleVersionHandler; + + +/** + * @author fgiust + * @version $Id$ + */ +public class SimplecacheModuleVersionHandler extends DiffSimpleModuleVersionHandler +{ + +} Property changes on: trunk/openutils-mgnlcache/src/main/java/net/sourceforge/openutils/mgnlsimplecache/module/SimplecacheModuleVersionHandler.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native Modified: trunk/openutils-mgnlcache/src/main/resources/META-INF/magnolia/simplecache.xml =================================================================== --- trunk/openutils-mgnlcache/src/main/resources/META-INF/magnolia/simplecache.xml 2011-04-27 12:28:50 UTC (rev 3429) +++ trunk/openutils-mgnlcache/src/main/resources/META-INF/magnolia/simplecache.xml 2011-04-27 12:41:15 UTC (rev 3430) @@ -4,6 +4,7 @@ <name>simplecache</name> <displayName>openutils simplecache</displayName> <description>An alternative "simple is beautiful" cache module for Magnolia</description> + <versionHandler>net.sourceforge.openutils.mgnlsimplecache.module.SimplecacheModuleVersionHandler</versionHandler> <version>${project.version}</version> <dependencies> <dependency> Added: trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/simplecache-nooverwrite/config.server.filters.simplecache.xml =================================================================== --- trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/simplecache-nooverwrite/config.server.filters.simplecache.xml (rev 0) +++ trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/simplecache-nooverwrite/config.server.filters.simplecache.xml 2011-04-27 12:41:15 UTC (rev 3430) @@ -0,0 +1,287 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sv:node sv:name="simplecache" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:content</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>789589e8-47f9-4907-936e-99de54260c91</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlsimplecache.filters.CacheFilter</sv:value> + </sv:property> + <sv:property sv:name="enabled" sv:type="String"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activatorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2006-07-28T23:39:30.812+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastaction" sv:type="Date"> + <sv:value>2006-08-10T10:28:55.135+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-04-02T23:16:06.086+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="cacheManager"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>53c7f4de-8e7e-426a-ad25-9ac91956c2c2</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlsimplecache.filesystem.FSCacheManager</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-03-19T16:47:27.135+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-03-28T13:24:06.571+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="repositoryUrls"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>326827d2-bc58-4e83-ba66-d92cf84b3f89</sv:value> + </sv:property> + <sv:property sv:name="0" sv:type="String"> + <sv:value>website:/</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2008-05-13T15:29:24.274+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-03-22T17:09:33.157+01:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + <sv:node sv:name="gzipVoter"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>bf2fd19a-d5cf-4a6e-a297-9af37d21ddca</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>info.magnolia.voting.voters.ResponseContentTypeVoter</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2008-05-13T15:28:30.192+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-04-03T14:03:37.503+02:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="allowed"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>9948ec61-689d-48a4-8256-780ba883cfdb</sv:value> + </sv:property> + <sv:property sv:name="1" sv:type="String"> + <sv:value>text/html</sv:value> + </sv:property> + <sv:property sv:name="2" sv:type="String"> + <sv:value>application/x-javascript</sv:value> + </sv:property> + <sv:property sv:name="3" sv:type="String"> + <sv:value>text/css</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:activated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2008-05-13T15:29:24.274+02:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-04-03T14:03:37.519+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> + </sv:node> + <sv:node sv:name="bypasses"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>c50380bd-5d9a-4037-b8f2-9aa23697f413</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-03-19T16:47:58.740+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-03-19T16:48:03.340+01:00</sv:value> + </sv:property> + </sv:node> + <sv:node sv:name="allinone"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:contentNode</sv:value> + </sv:property> + <sv:property sv:name="jcr:mixinTypes" sv:type="Name" sv:multiple="true"> + <sv:value>mix:lockable</sv:value> + </sv:property> + <sv:property sv:name="jcr:uuid" sv:type="String"> + <sv:value>bd641832-8026-4e04-b1be-0f77d2719981</sv:value> + </sv:property> + <sv:property sv:name="allowAdmin" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="allowAuthenticated" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="allowRequestWithParameters" sv:type="Boolean"> + <sv:value>false</sv:value> + </sv:property> + <sv:property sv:name="class" sv:type="String"> + <sv:value>net.sourceforge.openutils.mgnlsimplecache.voters.AllInOneCacheVoter</sv:value> + </sv:property> + <sv:property sv:name="contentTypesAllowed" sv:type="String"> + <sv:value>text/html,image/png,image/gif,image/jpeg</sv:value> + </sv:property> + <sv:property sv:name="contentTypesDenied" sv:type="String"> + <sv:value/> + </sv:property> + <sv:property sv:name="extensionsAllowed" sv:type="String"> + <sv:value/> + </sv:property> + <sv:property sv:name="extensionsDenied" sv:type="String"> + <sv:value/> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="pathsAllowed" sv:type="String"> + <sv:value/> + </sv:property> + <sv:property sv:name="pathsDenied" sv:type="String"> + <sv:value>/docroot,/.magnolia,/.resource</sv:value> + </sv:property> + <sv:node sv:name="MetaData"> + <sv:property sv:name="jcr:primaryType" sv:type="Name"> + <sv:value>mgnl:metaData</sv:value> + </sv:property> + <sv:property sv:name="jcr:createdBy" sv:type="String"> + <sv:value>admin</sv:value> + </sv:property> + <sv:property sv:name="mgnl:authorid" sv:type="String"> + <sv:value>superuser</sv:value> + </sv:property> + <sv:property sv:name="mgnl:creationdate" sv:type="Date"> + <sv:value>2010-03-22T17:09:45.783+01:00</sv:value> + </sv:property> + <sv:property sv:name="mgnl:lastmodified" sv:type="Date"> + <sv:value>2010-06-08T17:50:04.171+02:00</sv:value> + </sv:property> + </sv:node> + </sv:node> + </sv:node> +</sv:node> Property changes on: trunk/openutils-mgnlcache/src/main/resources/mgnl-bootstrap/simplecache-nooverwrite/config.server.filters.simplecache.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:keywords + Author Date Id Revision Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |