|
From: <mol...@us...> - 2008-05-07 09:00:35
|
Revision: 814
http://openutils.svn.sourceforge.net/openutils/?rev=814&view=rev
Author: molaschi
Date: 2008-05-07 02:00:41 -0700 (Wed, 07 May 2008)
Log Message:
-----------
[maven-release-plugin] copy for tag openutils-mgnlbootstrapsync-0.1
Added Paths:
-----------
tags/openutils-mgnlbootstrapsync-0.1/
tags/openutils-mgnlbootstrapsync-0.1/pom.xml
tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java
tags/openutils-mgnlbootstrapsync-0.1/src/site/
Removed Paths:
-------------
tags/openutils-mgnlbootstrapsync-0.1/pom.xml
tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java
Copied: tags/openutils-mgnlbootstrapsync-0.1 (from rev 806, trunk/openutils-mgnlbootstrapsync)
Deleted: tags/openutils-mgnlbootstrapsync-0.1/pom.xml
===================================================================
--- trunk/openutils-mgnlbootstrapsync/pom.xml 2008-04-29 12:54:36 UTC (rev 806)
+++ tags/openutils-mgnlbootstrapsync-0.1/pom.xml 2008-05-07 09:00:41 UTC (rev 814)
@@ -1,76 +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-mgnlbootstrapsync</artifactId>
- <name>openutils-mgnlbootstrapsync</name>
- <version>0.1-SNAPSHOT</version>
- <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-rc2</version>
- </dependency>
- <dependency>
- <groupId>info.magnolia</groupId>
- <artifactId>magnolia-module-admininterface</artifactId>
- <version>3.5.2</version>
- </dependency>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <classifier>jdk15</classifier>
- <version>5.1</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://svn.magnolia.info/maven/m2</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-</project>
Copied: tags/openutils-mgnlbootstrapsync-0.1/pom.xml (from rev 813, trunk/openutils-mgnlbootstrapsync/pom.xml)
===================================================================
--- tags/openutils-mgnlbootstrapsync-0.1/pom.xml (rev 0)
+++ tags/openutils-mgnlbootstrapsync-0.1/pom.xml 2008-05-07 09:00:41 UTC (rev 814)
@@ -0,0 +1,82 @@
+<?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-mgnlbootstrapsync</artifactId>
+ <name>openutils-mgnlbootstrapsync</name>
+ <version>0.1</version>
+ <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-rc2</version>
+ </dependency>
+ <dependency>
+ <groupId>info.magnolia</groupId>
+ <artifactId>magnolia-module-admininterface</artifactId>
+ <version>3.5.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <classifier>jdk15</classifier>
+ <version>5.1</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://svn.magnolia.info/maven/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-mgnlbootstrapsync-0.1</connection>
+ <developerConnection>scm:svn:https://openutils.svn.sourceforge.net/svnroot/openutils/tags/openutils-mgnlbootstrapsync-0.1</developerConnection>
+ <url>http://openutils.svn.sourceforge.net/viewcvs.cgi/openutils/tags/openutils-mgnlbootstrapsync-0.1</url>
+ </scm>
+</project>
Deleted: tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java
===================================================================
--- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-04-29 12:54:36 UTC (rev 806)
+++ tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-07 09:00:41 UTC (rev 814)
@@ -1,160 +0,0 @@
-package it.openutils.mgnlbootstrapsync.listener;
-
-import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.observation.Event;
-import javax.jcr.observation.EventIterator;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.jackrabbit.core.observation.EventImpl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * @author luca boati mmolaschi
- * @version $Id: $
- */
-public class BootstrapSyncListener extends AbstractBootstrapSyncListener
-{
-
- /**
- * Store operation
- * @author mmolaschi
- * @version $Id: $
- */
- public class JcrOperation
- {
-
- private String path;
-
- private boolean remove;
-
- /**
- * @param path path of operation
- * @param remove is a remove op?
- */
- public JcrOperation(String path, boolean remove)
- {
- this.path = path;
- this.remove = remove;
- }
- }
-
- private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class);
-
- /**
- * Configure listener on watch
- * @param watch watch
- */
- public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch)
- {
- super(watch);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public void onEvent(EventIterator events)
- {
- List<JcrOperation> operations = new ArrayList<JcrOperation>();
- while (events.hasNext())
- {
- // Event event
- EventImpl event = (EventImpl) events.nextEvent();
- String eventPath = null;
- try
- {
- eventPath = event.getPath();
- }
- catch (RepositoryException ex)
- {
- log.error(ex.getMessage(), ex);
- continue;
- }
- if (eventPath.startsWith("/jcr:"))
- {
- return;
- }
-
- switch (event.getType())
- {
- case Event.NODE_ADDED :
- log.debug(eventPath + " added");
- break;
- case Event.NODE_REMOVED :
- log.debug(eventPath + " removed");
- break;
- case Event.PROPERTY_ADDED :
- log.debug(eventPath + " added");
- break;
- case Event.PROPERTY_CHANGED :
- log.debug(eventPath + " changed");
- break;
- case Event.PROPERTY_REMOVED :
- log.debug(eventPath + " removed");
- break;
- default :
- break;
- }
-
- if (event.getType() == Event.NODE_REMOVED)
- {
- operations.add(new JcrOperation(eventPath, true));
- }
- else
- {
- operations.add(new JcrOperation(eventPath, false));
- }
- }
-
- // calculate minimum path and remove operation
- String basePath = null;
- JcrOperation remove = null;
- for (JcrOperation operation : operations)
- {
- if (operation.remove)
- {
- remove = operation;
- continue;
- }
-
- int basePathSl = StringUtils.countMatches(basePath, "/");
- int pathSl = StringUtils.countMatches(operation.path, "/");
-
- if (basePath == null || pathSl < basePathSl)
- {
- basePath = operation.path;
- }
- }
-
- if (remove != null)
- {
- if (log.isDebugEnabled())
- {
- log.debug("Removed PATH: " + remove.path);
- }
-
- removeNode(remove.path);
- }
-
- if (basePath != null)
- {
- // remove metadata if present
- basePath = StringUtils.substringBefore(basePath, "/MetaData");
-
- if (log.isDebugEnabled())
- {
- log.debug("Changed PATH: " + basePath);
- }
-
- exportNode(basePath);
- }
- }
-
-}
Copied: tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (from rev 811, trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java)
===================================================================
--- tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java (rev 0)
+++ tags/openutils-mgnlbootstrapsync-0.1/src/main/java/it/openutils/mgnlbootstrapsync/listener/BootstrapSyncListener.java 2008-05-07 09:00:41 UTC (rev 814)
@@ -0,0 +1,166 @@
+package it.openutils.mgnlbootstrapsync.listener;
+
+import info.magnolia.cms.beans.config.ConfigLoader;
+import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventIterator;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.jackrabbit.core.observation.EventImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * @author luca boati mmolaschi
+ * @version $Id: $
+ */
+public class BootstrapSyncListener extends AbstractBootstrapSyncListener
+{
+
+ /**
+ * Store operation
+ * @author mmolaschi
+ * @version $Id: $
+ */
+ public class JcrOperation
+ {
+
+ private String path;
+
+ private boolean remove;
+
+ /**
+ * @param path path of operation
+ * @param remove is a remove op?
+ */
+ public JcrOperation(String path, boolean remove)
+ {
+ this.path = path;
+ this.remove = remove;
+ }
+ }
+
+ private static Logger log = LoggerFactory.getLogger(BootstrapSyncListener.class);
+
+ /**
+ * Configure listener on watch
+ * @param watch watch
+ */
+ public BootstrapSyncListener(BootstrapSyncRepositoryWatch watch)
+ {
+ super(watch);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void onEvent(EventIterator events)
+ {
+ if (!ConfigLoader.isConfigured() || ConfigLoader.isBootstrapping())
+ {
+ return;
+ }
+
+ List<JcrOperation> operations = new ArrayList<JcrOperation>();
+ while (events.hasNext())
+ {
+ // Event event
+ EventImpl event = (EventImpl) events.nextEvent();
+ String eventPath = null;
+ try
+ {
+ eventPath = event.getPath();
+ }
+ catch (RepositoryException ex)
+ {
+ log.error(ex.getMessage(), ex);
+ continue;
+ }
+ if (eventPath.startsWith("/jcr:"))
+ {
+ return;
+ }
+
+ switch (event.getType())
+ {
+ case Event.NODE_ADDED :
+ log.debug(eventPath + " added");
+ break;
+ case Event.NODE_REMOVED :
+ log.debug(eventPath + " removed");
+ break;
+ case Event.PROPERTY_ADDED :
+ log.debug(eventPath + " added");
+ break;
+ case Event.PROPERTY_CHANGED :
+ log.debug(eventPath + " changed");
+ break;
+ case Event.PROPERTY_REMOVED :
+ log.debug(eventPath + " removed");
+ break;
+ default :
+ break;
+ }
+
+ if (event.getType() == Event.NODE_REMOVED)
+ {
+ operations.add(new JcrOperation(eventPath, true));
+ }
+ else
+ {
+ operations.add(new JcrOperation(eventPath, false));
+ }
+ }
+
+ // calculate minimum path and remove operation
+ String basePath = null;
+ JcrOperation remove = null;
+ for (JcrOperation operation : operations)
+ {
+ if (operation.remove)
+ {
+ remove = operation;
+ continue;
+ }
+
+ int basePathSl = StringUtils.countMatches(basePath, "/");
+ int pathSl = StringUtils.countMatches(operation.path, "/");
+
+ if (basePath == null || pathSl < basePathSl)
+ {
+ basePath = operation.path;
+ }
+ }
+
+ if (remove != null)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Removed PATH: " + remove.path);
+ }
+
+ removeNode(remove.path);
+ }
+
+ if (basePath != null)
+ {
+ // remove metadata if present
+ basePath = StringUtils.substringBefore(basePath, "/MetaData");
+
+ if (log.isDebugEnabled())
+ {
+ log.debug("Changed PATH: " + basePath);
+ }
+
+ exportNode(basePath);
+ }
+ }
+
+}
Copied: tags/openutils-mgnlbootstrapsync-0.1/src/site (from rev 812, trunk/openutils-mgnlbootstrapsync/src/site)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|