|
From: <fg...@us...> - 2008-04-28 22:19:32
|
Revision: 801
http://openutils.svn.sourceforge.net/openutils/?rev=801&view=rev
Author: fgiust
Date: 2008-04-28 15:19:38 -0700 (Mon, 28 Apr 2008)
Log Message:
-----------
[maven-release-plugin] copy for tag openutils-mgnltasks-3.5.1
Added Paths:
-----------
tags/openutils-mgnltasks-3.5.1/
tags/openutils-mgnltasks-3.5.1/pom.xml
tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java
tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java
tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml
tags/openutils-mgnltasks-3.5.1/src/site/site.xml
Removed Paths:
-------------
tags/openutils-mgnltasks-3.5.1/pom.xml
tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml
tags/openutils-mgnltasks-3.5.1/src/site/site.xml
Copied: tags/openutils-mgnltasks-3.5.1 (from rev 784, trunk/openutils-mgnltasks)
Deleted: tags/openutils-mgnltasks-3.5.1/pom.xml
===================================================================
--- trunk/openutils-mgnltasks/pom.xml 2008-04-27 20:42:00 UTC (rev 784)
+++ tags/openutils-mgnltasks-3.5.1/pom.xml 2008-04-28 22:19:38 UTC (rev 801)
@@ -1,90 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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</artifactId>
- <version>8</version>
- <relativePath>..</relativePath>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <packaging>jar</packaging>
- <artifactId>openutils-mgnltasks</artifactId>
- <name>openutils-mgnltasks</name>
- <version>3.5-SNAPSHOT</version>
- <description>A collection of useful magnolia update tasks that can be reused in custom modules</description>
- <licenses>
- <license>
- <name>GPLv3</name>
- <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
- </license>
- </licenses>
- <build>
- <resources>
- <resource>
- <filtering>false</filtering>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- <resource>
- <filtering>true</filtering>
- <directory>src/main/resources</directory>
- <includes>
- <include>META-INF/magnolia/*</include>
- </includes>
- </resource>
- </resources>
- </build>
- <dependencies>
- <dependency>
- <groupId>info.magnolia</groupId>
- <artifactId>magnolia-core</artifactId>
- <version>3.5.4</version>
- </dependency>
- <dependency>
- <groupId>info.magnolia</groupId>
- <artifactId>magnolia-module-admininterface</artifactId>
- <version>3.5.4</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- <version>5.7</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
- <repositories>
- <repository>
- <id>repository.magnolia.info</id>
- <name>magnolia repository</name>
- <url>http://repo.magnolia.info/m2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-</project>
Copied: tags/openutils-mgnltasks-3.5.1/pom.xml (from rev 800, trunk/openutils-mgnltasks/pom.xml)
===================================================================
--- tags/openutils-mgnltasks-3.5.1/pom.xml (rev 0)
+++ tags/openutils-mgnltasks-3.5.1/pom.xml 2008-04-28 22:19:38 UTC (rev 801)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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</artifactId>
+ <version>8</version>
+ <relativePath>..</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <packaging>jar</packaging>
+ <artifactId>openutils-mgnltasks</artifactId>
+ <name>openutils-mgnltasks</name>
+ <version>3.5.1</version>
+ <description>A collection of useful magnolia update tasks that can be reused in custom modules</description>
+ <licenses>
+ <license>
+ <name>GPLv3</name>
+ <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
+ </license>
+ </licenses>
+ <build>
+ <resources>
+ <resource>
+ <filtering>false</filtering>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <resource>
+ <filtering>true</filtering>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>META-INF/magnolia/*</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>info.magnolia</groupId>
+ <artifactId>magnolia-core</artifactId>
+ <version>3.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>info.magnolia</groupId>
+ <artifactId>magnolia-module-admininterface</artifactId>
+ <version>3.5.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ <version>5.7</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ <repositories>
+ <repository>
+ <id>repository.magnolia.info</id>
+ <name>magnolia repository</name>
+ <url>http://repo.magnolia.info/m2</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <scm>
+ <connection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</connection>
+ <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnltasks-3.5.1</developerConnection>
+ <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnltasks-3.5.1</url>
+ </scm>
+</project>
Copied: tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java (from rev 799, trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java)
===================================================================
--- tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java (rev 0)
+++ tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/SimpleModuleVersionHandler.java 2008-04-28 22:19:38 UTC (rev 801)
@@ -0,0 +1,85 @@
+/**
+ * Copyright Openmind 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 it.openutils.mgnltasks;
+
+import info.magnolia.module.DefaultModuleVersionHandler;
+import info.magnolia.module.InstallContext;
+import info.magnolia.module.delta.Delta;
+import info.magnolia.module.delta.DeltaBuilder;
+import info.magnolia.module.model.Version;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.lang.ObjectUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * A base module version handler that re-bootstrap its configuration each time the version number changes. Can be used
+ * as is or subclassed (usually overriding getStartupTasks() for configuration tweacks).
+ * @author fgiust
+ * @version $Id: $
+ */
+public class SimpleModuleVersionHandler extends DefaultModuleVersionHandler
+{
+
+ /**
+ * Logger.
+ */
+ protected Logger log = LoggerFactory.getLogger(getClass());
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<Delta> getDeltas(InstallContext ctx, Version from)
+ {
+ if (from == null)
+ {
+ log.info("Actual version not set");
+ return super.getDeltas(ctx, from);
+ }
+
+ Version to = ctx.getCurrentModuleDefinition().getVersionDefinition();
+
+ List<Delta> deltas = new ArrayList<Delta>();
+
+ if (!to.isEquivalent(from)
+ || "${project.version}".equals(ObjectUtils.toString(from))
+ || "SNAPSHOT".equals(from.getClassifier()))
+ {
+ log.info("Updating from version {}", from);
+
+ Delta delta = DeltaBuilder.update(to, "Update to current version");
+ delta.getTasks().add(new ModuleConfigBootstrapTask(ctx.getCurrentModuleDefinition().getName()));
+ delta.getTasks().add(new UpdateModuleVersionTask());
+
+ deltas.add(delta);
+ }
+ else
+ {
+ log.info("Version {} already installed, no update tasks to run", from);
+ }
+
+ return deltas;
+ }
+
+}
Copied: tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java (from rev 798, trunk/openutils-mgnltasks/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java)
===================================================================
--- tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java (rev 0)
+++ tags/openutils-mgnltasks-3.5.1/src/main/java/it/openutils/mgnltasks/UpdateModuleVersionTask.java 2008-04-28 22:19:38 UTC (rev 801)
@@ -0,0 +1,63 @@
+/**
+ * Copyright Openmind 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 it.openutils.mgnltasks;
+
+import info.magnolia.cms.core.Content;
+import info.magnolia.cms.core.HierarchyManager;
+import info.magnolia.cms.core.ItemType;
+import info.magnolia.cms.core.NodeData;
+import info.magnolia.cms.util.NodeDataUtil;
+import info.magnolia.module.InstallContext;
+import info.magnolia.module.delta.AbstractRepositoryTask;
+import info.magnolia.module.delta.TaskExecutionException;
+
+import javax.jcr.RepositoryException;
+
+
+/**
+ * A task that updates the current version of a module stored in the config repository.
+ * @author fgiust
+ * @version $Id: $
+ */
+public class UpdateModuleVersionTask extends AbstractRepositoryTask
+{
+
+ public UpdateModuleVersionTask()
+ {
+ super("Version number", "Sets installed module version number");
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void doExecute(InstallContext ctx) throws RepositoryException, TaskExecutionException
+ {
+ // make sure we have the /modules node
+ if (!ctx.hasModulesNode())
+ {
+ final HierarchyManager hm = ctx.getConfigHierarchyManager();
+ hm.createContent("/", "modules", ItemType.CONTENT.getSystemName());
+ }
+
+ final Content moduleNode = ctx.getOrCreateCurrentModuleNode();
+ final NodeData nodeData = NodeDataUtil.getOrCreate(moduleNode, "version");
+ nodeData.setValue(ctx.getCurrentModuleDefinition().getVersionDefinition().toString());
+ }
+
+}
\ No newline at end of file
Deleted: tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml
===================================================================
--- trunk/openutils-mgnltasks/src/site/changes/changes.xml 2008-04-27 20:42:00 UTC (rev 784)
+++ tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml 2008-04-28 22:19:38 UTC (rev 801)
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-<!--
- "type" attribute can be: add, remove, update or fix.
--->
-<document>
- <properties>
- <title>Changes</title>
- <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author>
- </properties>
- <body>
- <release version="3.5" date="2008-04-27" description="first release">
- <action type="add" dev="fgiust">First public release. The version is labeled "3.5" in order to make clear which
- version of magnolia is required.</action>
- </release>
- </body>
-</document>
\ No newline at end of file
Copied: tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml (from rev 798, trunk/openutils-mgnltasks/src/site/changes/changes.xml)
===================================================================
--- tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml (rev 0)
+++ tags/openutils-mgnltasks-3.5.1/src/site/changes/changes.xml 2008-04-28 22:19:38 UTC (rev 801)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<!--
+ "type" attribute can be: add, remove, update or fix.
+-->
+<document>
+ <properties>
+ <title>Changes</title>
+ <author email="fgiust(at)users.sourceforge.net">Fabrizio Giustina</author>
+ </properties>
+ <body>
+ <release version="3.5.1" date="2008-04-28" description="3.5.1">
+ <action type="add" dev="fgiust">Added UpdateModuleVersionTask.</action>
+ <action type="add" dev="fgiust">Added SimpleModuleVersionHandler.</action>
+ </release>
+ <release version="3.5" date="2008-04-27" description="first release">
+ <action type="add" dev="fgiust">First public release. The version is labeled "3.5" in order to make clear which
+ version of magnolia is required.</action>
+ </release>
+ </body>
+</document>
\ No newline at end of file
Deleted: tags/openutils-mgnltasks-3.5.1/src/site/site.xml
===================================================================
--- trunk/openutils-mgnltasks/src/site/site.xml 2008-04-27 20:42:00 UTC (rev 784)
+++ tags/openutils-mgnltasks-3.5.1/src/site/site.xml 2008-04-28 22:19:38 UTC (rev 801)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project name="Openutils mgnltasks">
- <publishDate position="navigation-bottom" format="yyyy-MM-dd" />
- <version position="navigation-bottom" />
- <bannerRight>
- <name>Openutils</name>
- <src>http://openutils.sourceforge.net/images/openutils-logo.png</src>
- <href>http://openutils.sourceforge.net</href>
- </bannerRight>
- <bannerLeft>
- <name>Sourceforge</name>
- <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src>
- <href>http://www.sourceforge.net/projects/openutils</href>
- </bannerLeft>
- <body>
- <head>
- <link rel="icon" href="images/favicon.ico" />
- </head>
- <breadcrumbs>
- <item name="openutils" href="http://openutils.sourceforge.net/" />
- <item name="openutils-mgnltasks" href="http://openutils.sourceforge.net/openutils-mgnltasks" />
- </breadcrumbs>
- <menu name="openutils mgnltasks">
- <item name="Introduction" href="index.html"></item>
- </menu>
- <menu ref="modules" inherit="bottom" />
- <menu ref="reports" inherit="bottom" />
- </body>
- <skin>
- <groupId>net.sourceforge.openutils</groupId>
- <artifactId>openutils-maven-skin</artifactId>
- <version>1.0</version>
- </skin>
-</project>
Copied: tags/openutils-mgnltasks-3.5.1/src/site/site.xml (from rev 794, trunk/openutils-mgnltasks/src/site/site.xml)
===================================================================
--- tags/openutils-mgnltasks-3.5.1/src/site/site.xml (rev 0)
+++ tags/openutils-mgnltasks-3.5.1/src/site/site.xml 2008-04-28 22:19:38 UTC (rev 801)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="Openutils mgnltasks">
+ <publishDate position="navigation-bottom" format="yyyy-MM-dd" />
+ <version position="navigation-bottom" />
+ <bannerRight>
+ <name>Openutils</name>
+ <src>http://openutils.sourceforge.net/images/openutils-logo.png</src>
+ <href>http://openutils.sourceforge.net</href>
+ </bannerRight>
+ <bannerLeft>
+ <name>Sourceforge</name>
+ <src>http://sourceforge.net/sflogo.php?group_id=150467&amp;type=2</src>
+ <href>http://www.sourceforge.net/projects/openutils</href>
+ </bannerLeft>
+ <body>
+ <head>
+ <link rel="icon" href="images/favicon.ico" />
+ </head>
+ <breadcrumbs>
+ <item name="openutils" href="http://openutils.sourceforge.net/" />
+ <item name="openutils-mgnltasks" href="http://openutils.sourceforge.net/openutils-mgnltasks" />
+ </breadcrumbs>
+ <menu name="openutils mgnltasks">
+ <item name="Introduction" href="index.html"></item>
+ </menu>
+ <menu ref="modules" inherit="bottom" />
+ <menu ref="reports" inherit="bottom" />
+ </body>
+ <skin>
+ <groupId>net.sourceforge.openutils</groupId>
+ <artifactId>openutils-maven-skin</artifactId>
+ <version>1.1</version>
+ </skin>
+</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|