From: <mol...@us...> - 2010-06-18 15:41:45
|
Revision: 2686 http://openutils.svn.sourceforge.net/openutils/?rev=2686&view=rev Author: molaschi Date: 2010-06-18 15:41:38 +0000 (Fri, 18 Jun 2010) Log Message: ----------- MEDIA-156 updated mgnltasks to 4.1.2 and removed SamplesExtractionTask Modified Paths: -------------- trunk/openutils-mgnlmedia/pom.xml trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java Removed Paths: ------------- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/SamplesExtractionTask.java Modified: trunk/openutils-mgnlmedia/pom.xml =================================================================== --- trunk/openutils-mgnlmedia/pom.xml 2010-06-18 15:27:40 UTC (rev 2685) +++ trunk/openutils-mgnlmedia/pom.xml 2010-06-18 15:41:38 UTC (rev 2686) @@ -102,7 +102,7 @@ <dependency> <groupId>net.sourceforge.openutils</groupId> <artifactId>openutils-mgnltasks</artifactId> - <version>4.0.5</version> + <version>4.1.2</version> </dependency> <dependency> <groupId>net.sourceforge.openutils</groupId> Modified: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java 2010-06-18 15:27:40 UTC (rev 2685) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/MediaModuleVersionHandler.java 2010-06-18 15:41:38 UTC (rev 2686) @@ -29,6 +29,7 @@ import it.openutils.mgnltasks.ChangeExistingPropertyTask; import it.openutils.mgnltasks.CreateMissingPropertyTask; import it.openutils.mgnltasks.NodeSortTask; +import it.openutils.mgnltasks.SamplesExtractionTask; import it.openutils.mgnltasks.SimpleModuleVersionHandler; import java.util.ArrayList; Deleted: trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/SamplesExtractionTask.java =================================================================== --- trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/SamplesExtractionTask.java 2010-06-18 15:27:40 UTC (rev 2685) +++ trunk/openutils-mgnlmedia/src/main/java/net/sourceforge/openutils/mgnlmedia/media/setup/SamplesExtractionTask.java 2010-06-18 15:41:38 UTC (rev 2686) @@ -1,91 +0,0 @@ -/** - * - * Magnolia SimpleMedia Module (http://www.openmindlab.com/lab/products/media.html) - * Copyright (C)2008 - 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.mgnlmedia.media.setup; - -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.Path; -import info.magnolia.module.InstallContext; -import info.magnolia.module.delta.AbstractTask; -import info.magnolia.module.delta.TaskExecutionException; -import info.magnolia.module.files.FileExtractionLogger; -import info.magnolia.module.files.FileExtractor; -import info.magnolia.module.files.MD5CheckingFileExtractor; - -import java.io.IOException; - -import org.apache.commons.lang.StringUtils; - - -/** - * Extract samples files to webapp root. - * @author fgiust - * @version $Id$ - */ -public class SamplesExtractionTask extends AbstractTask -{ - - public SamplesExtractionTask() - { - super("Samples extraction", "Extracts jsp files for samples."); - } - - /** - * {@inheritDoc} - */ - public void execute(final InstallContext ctx) throws TaskExecutionException - { - final HierarchyManager hm = ctx.getConfigHierarchyManager(); - final MD5CheckingFileExtractor extractor = new MD5CheckingFileExtractor(new FileExtractionLogger() - { - - public void error(String message) - { - ctx.warn(message); - } - }, hm); - try - { - extractor.extractFiles(new FileExtractor.Transformer() - { - - public String accept(String resourcePath) - { - final boolean thisIsAFileWeWant = resourcePath.startsWith("/mgnl-files/") - && StringUtils.contains(resourcePath, "/samples-media/"); - if (!thisIsAFileWeWant) - { - return null; - } - final String relTargetPath = StringUtils.removeStart(resourcePath, "/mgnl-files/"); - return Path.getAbsoluteFileSystemPath(relTargetPath); - } - - }); - } - catch (IOException e) - { - throw new TaskExecutionException("Could not extract files for module " - + ctx.getCurrentModuleDefinition() - + ": " - + e.getMessage(), e); - } - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |