jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edgarp...@apache.org
Subject svn commit: r312896 [6/6] - in /incubator/jackrabbit/trunk/contrib/jcr-commands: ./ src/java/org/apache/jackrabbit/command/ src/java/org/apache/jackrabbit/command/cli/ src/java/org/apache/jackrabbit/command/collect/ src/java/org/apache/jackrabbit/comma...
Date Tue, 11 Oct 2005 14:41:03 GMT
Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Merge.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Merge.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Merge.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Merge.java
Tue Oct 11 07:38:54 2005
@@ -25,87 +25,78 @@
 /**
  * Merge
  */
-public class Merge implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Merge.class);
-
-	// ---------------------------- < keys >
-	/** node path */
-	private String pathKey = "path";
-
-	/** source workspace key */
-	private String srcWorkspaceKey = "srcWorkspace";
-
-	/** best effort key */
-	private String bestEffortKey = "bestEffort";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-		String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
-		boolean bestEffort = Boolean.valueOf(
-				(String) ctx.get(this.bestEffortKey)).booleanValue();
-		if (log.isDebugEnabled())
-		{
-			log.debug("merging node at " + path + " from workspace "
-					+ srcWorkspace + " besteffort=" + bestEffort);
-		}
-		CommandHelper.getNode(ctx, path).merge(srcWorkspace, bestEffort);
-		return false;
-	}
-
-	/**
-	 * @return Returns the bestEffortKey.
-	 */
-	public String getBestEffortKey()
-	{
-		return bestEffortKey;
-	}
-
-	/**
-	 * @param bestEffortKey
-	 *            The bestEffortKey to set.
-	 */
-	public void setBestEffortKey(String bestEffortKey)
-	{
-		this.bestEffortKey = bestEffortKey;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
-
-	/**
-	 * @return Returns the srcWorkspaceKey.
-	 */
-	public String getSrcWorkspaceKey()
-	{
-		return srcWorkspaceKey;
-	}
-
-	/**
-	 * @param srcWorkspaceKey
-	 *            The srcWorkspaceKey to set.
-	 */
-	public void setSrcWorkspaceKey(String srcWorkspaceKey)
-	{
-		this.srcWorkspaceKey = srcWorkspaceKey;
-	}
+public class Merge implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Merge.class);
+
+    // ---------------------------- < keys >
+    /** node path */
+    private String pathKey = "path";
+
+    /** source workspace key */
+    private String srcWorkspaceKey = "srcWorkspace";
+
+    /** best effort key */
+    private String bestEffortKey = "bestEffort";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+        String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
+        boolean bestEffort = Boolean.valueOf(
+            (String) ctx.get(this.bestEffortKey)).booleanValue();
+        if (log.isDebugEnabled()) {
+            log.debug("merging node at " + path + " from workspace "
+                    + srcWorkspace + " besteffort=" + bestEffort);
+        }
+        CommandHelper.getNode(ctx, path).merge(srcWorkspace, bestEffort);
+        return false;
+    }
+
+    /**
+     * @return the best effort key
+     */
+    public String getBestEffortKey() {
+        return bestEffortKey;
+    }
+
+    /**
+     * @param bestEffortKey
+     *        the best effort key to set
+     */
+    public void setBestEffortKey(String bestEffortKey) {
+        this.bestEffortKey = bestEffortKey;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
+
+    /**
+     * @return the source <code>Workspace</code> key
+     */
+    public String getSrcWorkspaceKey() {
+        return srcWorkspaceKey;
+    }
+
+    /**
+     * @param srcWorkspaceKey
+     *        the source <code>Workspace</code> key to set
+     */
+    public void setSrcWorkspaceKey(String srcWorkspaceKey) {
+        this.srcWorkspaceKey = srcWorkspaceKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersion.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersion.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersion.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersion.java
Tue Oct 11 07:38:54 2005
@@ -23,10 +23,9 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * remove a version from the versio history
+ * Remove a <code>Version</code> from the <code>VersionHistory</code>
  */
-public class RemoveVersion implements Command
-{
+public class RemoveVersion implements Command {
     /** logger */
     private static Log log = LogFactory.getLog(RemoveVersion.class);
 
@@ -38,14 +37,12 @@
     private String nameKey = "name";
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public boolean execute(Context ctx) throws Exception
-    {
+    public boolean execute(Context ctx) throws Exception {
         String path = (String) ctx.get(this.pathKey);
         String versionName = (String) ctx.get(this.nameKey);
-        if (log.isDebugEnabled())
-        {
+        if (log.isDebugEnabled()) {
             log.debug("Remove version " + versionName + " from node " + path);
         }
         CommandHelper.getNode(ctx, path).getVersionHistory().removeVersion(
@@ -54,36 +51,32 @@
     }
 
     /**
-     * @return Returns the pathKey.
+     * @return the path key
      */
-    public String getPathKey()
-    {
+    public String getPathKey() {
         return pathKey;
     }
 
     /**
      * @param pathKey
-     *            The pathKey to set.
+     *        the path key to set
      */
-    public void setPathKey(String pathKey)
-    {
+    public void setPathKey(String pathKey) {
         this.pathKey = pathKey;
     }
 
     /**
-     * @return Returns the versionNameKey.
+     * @return the version name key
      */
-    public String getNameKey()
-    {
+    public String getNameKey() {
         return nameKey;
     }
 
     /**
      * @param versionNameKey
-     *            The versionNameKey to set.
+     *        the version name key to set
      */
-    public void setNameKey(String versionNameKey)
-    {
+    public void setNameKey(String versionNameKey) {
         this.nameKey = versionNameKey;
     }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionByLabel.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionByLabel.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionByLabel.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionByLabel.java
Tue Oct 11 07:38:54 2005
@@ -26,70 +26,64 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * remove a version from the versio history
+ * Remove the <code>Version</code> from the <code>VersionHistory</code>
that
+ * match the given label
  */
-public class RemoveVersionByLabel implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(RemoveVersionByLabel.class);
-
-	// ---------------------------- < keys >
-	/** node path */
-	private String pathKey = "path";
-
-	/** version label key */
-	private String labelKey = "label";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-		String label = (String) ctx.get(this.labelKey);
-		if (log.isDebugEnabled())
-		{
-			log.debug("Remove version with label " + label + " from node "
-					+ path);
-		}
-		VersionHistory vh = CommandHelper.getNode(ctx, path)
-				.getVersionHistory();
-		Version v = vh.getVersionByLabel(label);
-		vh.removeVersion(v.getName());
-		return false;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
-
-	/**
-	 * @return Returns the versionNameKey.
-	 */
-	public String getLabelKey()
-	{
-		return labelKey;
-	}
-
-	/**
-	 * @param versionNameKey
-	 *            The versionNameKey to set.
-	 */
-	public void setLabelKey(String versionNameKey)
-	{
-		this.labelKey = versionNameKey;
-	}
+public class RemoveVersionByLabel implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(RemoveVersionByLabel.class);
+
+    // ---------------------------- < keys >
+    /** node path */
+    private String pathKey = "path";
+
+    /** version label key */
+    private String labelKey = "label";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+        String label = (String) ctx.get(this.labelKey);
+        if (log.isDebugEnabled()) {
+            log.debug("Remove version with label " + label + " from node "
+                    + path);
+        }
+        VersionHistory vh = CommandHelper.getNode(ctx, path)
+            .getVersionHistory();
+        Version v = vh.getVersionByLabel(label);
+        vh.removeVersion(v.getName());
+        return false;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
+
+    /**
+     * @return the version name key
+     */
+    public String getLabelKey() {
+        return labelKey;
+    }
+
+    /**
+     * @param versionNameKey
+     *        the version name key to set
+     */
+    public void setLabelKey(String versionNameKey) {
+        this.labelKey = versionNameKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionLabel.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionLabel.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionLabel.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RemoveVersionLabel.java
Tue Oct 11 07:38:54 2005
@@ -23,67 +23,60 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * remove version label
+ * Remove a label from the <code>VersionHistory</code>
  */
-public class RemoveVersionLabel implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(RemoveVersionLabel.class);
-
-	// ---------------------------- < keys >
-	/** node path */
-	private String pathKey = "path";
-
-	/** version label key */
-	private String labelKey = "label";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-		String versionLabel = (String) ctx.get(this.labelKey);
-		if (log.isDebugEnabled())
-		{
-			log.debug("Remove label " + versionLabel + " from node " + path);
-		}
-		CommandHelper.getNode(ctx, path).getVersionHistory()
-				.removeVersionLabel(versionLabel);
-		return false;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
-
-	/**
-	 * @return Returns the versionLabelKey.
-	 */
-	public String getLabelKey()
-	{
-		return labelKey;
-	}
-
-	/**
-	 * @param versionLabelKey
-	 *            The versionLabelKey to set.
-	 */
-	public void setLabelKey(String versionLabelKey)
-	{
-		this.labelKey = versionLabelKey;
-	}
+public class RemoveVersionLabel implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(RemoveVersionLabel.class);
+
+    // ---------------------------- < keys >
+    /** node path */
+    private String pathKey = "path";
+
+    /** version label key */
+    private String labelKey = "label";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+        String versionLabel = (String) ctx.get(this.labelKey);
+        if (log.isDebugEnabled()) {
+            log.debug("Remove label " + versionLabel + " from node " + path);
+        }
+        CommandHelper.getNode(ctx, path).getVersionHistory()
+            .removeVersionLabel(versionLabel);
+        return false;
+    }
+
+    /**
+     * @return returns the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
+
+    /**
+     * @return the version label key.
+     */
+    public String getLabelKey() {
+        return labelKey;
+    }
+
+    /**
+     * @param versionLabelKey
+     *        the version label key to set
+     */
+    public void setLabelKey(String versionLabelKey) {
+        this.labelKey = versionLabelKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Restore.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Restore.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Restore.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/Restore.java
Tue Oct 11 07:38:54 2005
@@ -23,89 +23,80 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Restore a node to the given version
+ * Restore a <code>Node</code> to the state of the given <code>Version</code>
  */
-public class Restore implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(Restore.class);
-
-	// ---------------------------- < keys >
-	/** node path */
-	private String pathKey = "path";
-
-	/** version name key */
-	private String versionKey = "version";
-
-	/** remove existing node key */
-	private String removeExistingKey = "removeExisting";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-		String versionName = (String) ctx.get(this.versionKey);
-		boolean removeExisting = Boolean.valueOf(
-				(String) ctx.get(this.removeExistingKey)).booleanValue();
-		if (log.isDebugEnabled())
-		{
-			log.debug("restoring node at " + path + " to version "
-					+ versionName + " removeexisting=" + removeExisting);
-		}
-		CommandHelper.getNode(ctx, path).restore(versionName, removeExisting);
-		return false;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
-
-	/**
-	 * @return Returns the removeExistingKey.
-	 */
-	public String getRemoveExistingKey()
-	{
-		return removeExistingKey;
-	}
-
-	/**
-	 * @param removeExistingKey
-	 *            The removeExistingKey to set.
-	 */
-	public void setRemoveExistingKey(String removeExistingKey)
-	{
-		this.removeExistingKey = removeExistingKey;
-	}
-
-	/**
-	 * @return Returns the versionNameKey.
-	 */
-	public String getVersionKey()
-	{
-		return versionKey;
-	}
-
-	/**
-	 * @param versionNameKey
-	 *            The versionNameKey to set.
-	 */
-	public void setVersionKey(String versionNameKey)
-	{
-		this.versionKey = versionNameKey;
-	}
+public class Restore implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(Restore.class);
+
+    // ---------------------------- < keys >
+    /** node path */
+    private String pathKey = "path";
+
+    /** version name key */
+    private String versionKey = "version";
+
+    /** remove existing node key */
+    private String removeExistingKey = "removeExisting";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+        String versionName = (String) ctx.get(this.versionKey);
+        boolean removeExisting = Boolean.valueOf(
+            (String) ctx.get(this.removeExistingKey)).booleanValue();
+        if (log.isDebugEnabled()) {
+            log.debug("restoring node at " + path + " to version "
+                    + versionName + " removeexisting=" + removeExisting);
+        }
+        CommandHelper.getNode(ctx, path).restore(versionName, removeExisting);
+        return false;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
+
+    /**
+     * @return the remove existing key
+     */
+    public String getRemoveExistingKey() {
+        return removeExistingKey;
+    }
+
+    /**
+     * @param removeExistingKey
+     *        the remove existing key to set
+     */
+    public void setRemoveExistingKey(String removeExistingKey) {
+        this.removeExistingKey = removeExistingKey;
+    }
+
+    /**
+     * @return the version name key
+     */
+    public String getVersionKey() {
+        return versionKey;
+    }
+
+    /**
+     * @param versionNameKey
+     *        the version name key to set
+     */
+    public void setVersionKey(String versionNameKey) {
+        this.versionKey = versionNameKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RestoreByLabel.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RestoreByLabel.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RestoreByLabel.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/version/RestoreByLabel.java
Tue Oct 11 07:38:54 2005
@@ -23,90 +23,82 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Restore a node to the version with the specified label
+ * Restore a <code>Node</code> to the state of the <code>Version</code>
with
+ * the specified label
  */
-public class RestoreByLabel implements Command
-{
-	/** logger */
-	private static Log log = LogFactory.getLog(RestoreByLabel.class);
-
-	// ---------------------------- < keys >
-	/** node path */
-	private String pathKey = "path";
-
-	/** version name key */
-	private String labelKey = "label";
-
-	/** remove existing node key */
-	private String removeExistingKey = "removeExisting";
-
-	/**
-	 * @inheritDoc
-	 */
-	public boolean execute(Context ctx) throws Exception
-	{
-		String path = (String) ctx.get(this.pathKey);
-		String versionLabel = (String) ctx.get(this.labelKey);
-		boolean removeExisting = Boolean.valueOf(
-				(String) ctx.get(this.removeExistingKey)).booleanValue();
-		if (log.isDebugEnabled())
-		{
-			log.debug("restoring node at " + path + " to version label "
-					+ versionLabel + " removeexisting=" + removeExisting);
-		}
-		CommandHelper.getNode(ctx, path).restoreByLabel(versionLabel,
-				removeExisting);
-		return false;
-	}
-
-	/**
-	 * @return Returns the pathKey.
-	 */
-	public String getPathKey()
-	{
-		return pathKey;
-	}
-
-	/**
-	 * @param pathKey
-	 *            The pathKey to set.
-	 */
-	public void setPathKey(String pathKey)
-	{
-		this.pathKey = pathKey;
-	}
-
-	/**
-	 * @return Returns the removeExistingKey.
-	 */
-	public String getRemoveExistingKey()
-	{
-		return removeExistingKey;
-	}
-
-	/**
-	 * @param removeExistingKey
-	 *            The removeExistingKey to set.
-	 */
-	public void setRemoveExistingKey(String removeExistingKey)
-	{
-		this.removeExistingKey = removeExistingKey;
-	}
-
-	/**
-	 * @return Returns the versionNameKey.
-	 */
-	public String getLabelKey()
-	{
-		return labelKey;
-	}
-
-	/**
-	 * @param versionNameKey
-	 *            The versionNameKey to set.
-	 */
-	public void setLabelKey(String versionNameKey)
-	{
-		this.labelKey = versionNameKey;
-	}
+public class RestoreByLabel implements Command {
+    /** logger */
+    private static Log log = LogFactory.getLog(RestoreByLabel.class);
+
+    // ---------------------------- < keys >
+    /** node path */
+    private String pathKey = "path";
+
+    /** version name key */
+    private String labelKey = "label";
+
+    /** remove existing node key */
+    private String removeExistingKey = "removeExisting";
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean execute(Context ctx) throws Exception {
+        String path = (String) ctx.get(this.pathKey);
+        String versionLabel = (String) ctx.get(this.labelKey);
+        boolean removeExisting = Boolean.valueOf(
+            (String) ctx.get(this.removeExistingKey)).booleanValue();
+        if (log.isDebugEnabled()) {
+            log.debug("restoring node at " + path + " to version label "
+                    + versionLabel + " removeexisting=" + removeExisting);
+        }
+        CommandHelper.getNode(ctx, path).restoreByLabel(versionLabel,
+            removeExisting);
+        return false;
+    }
+
+    /**
+     * @return the path key
+     */
+    public String getPathKey() {
+        return pathKey;
+    }
+
+    /**
+     * @param pathKey
+     *        the path key to set
+     */
+    public void setPathKey(String pathKey) {
+        this.pathKey = pathKey;
+    }
+
+    /**
+     * @return the remove existing key
+     */
+    public String getRemoveExistingKey() {
+        return removeExistingKey;
+    }
+
+    /**
+     * @param removeExistingKey
+     *        the remove existing key to set
+     */
+    public void setRemoveExistingKey(String removeExistingKey) {
+        this.removeExistingKey = removeExistingKey;
+    }
+
+    /**
+     * @return the version name key
+     */
+    public String getLabelKey() {
+        return labelKey;
+    }
+
+    /**
+     * @param versionNameKey
+     *        the version name key to set
+     */
+    public void setLabelKey(String versionNameKey) {
+        this.labelKey = versionNameKey;
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/AbstractExportViewToFile.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/AbstractExportViewToFile.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/AbstractExportViewToFile.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/AbstractExportViewToFile.java
Tue Oct 11 07:38:54 2005
@@ -36,8 +36,7 @@
 /**
  * Export the xml view to a file
  */
-public abstract class AbstractExportViewToFile implements Command
-{
+public abstract class AbstractExportViewToFile implements Command {
     /** logger */
     private static Log log = LogFactory.getLog(AbstractExportViewToFile.class);
 
@@ -63,23 +62,19 @@
      * @throws IOException
      */
     protected OutputStream getOutputStream(Context ctx)
-            throws CommandException, IOException
-    {
+            throws CommandException, IOException {
         String to = (String) ctx.get(this.desFsPathKey);
         boolean overwrite = Boolean
             .valueOf((String) ctx.get(this.overwriteKey)).booleanValue();
         File f = new File(to);
 
-        if (f.exists() && !overwrite)
-        {
-            throw new CommandException("exception.file.exists", new String[]
-            {
+        if (f.exists() && !overwrite) {
+            throw new CommandException("exception.file.exists", new String[] {
                 to
             });
         }
 
-        if (!f.exists())
-        {
+        if (!f.exists()) {
             f.createNewFile();
         }
 
@@ -90,102 +85,90 @@
     }
 
     /**
-     * @return Returns the noRecurseKey.
+     * @return the no recurse key
      */
-    public String getNoRecurseKey()
-    {
+    public String getNoRecurseKey() {
         return noRecurseKey;
     }
 
     /**
      * @param noRecurseKey
-     *            Set the context attribute key for the noRecurse attribute.
+     *        the no recurse key to set
      */
-    public void setNoRecurseKey(String noRecurseKey)
-    {
+    public void setNoRecurseKey(String noRecurseKey) {
         this.noRecurseKey = noRecurseKey;
     }
 
     /**
-     * @return Returns the overwriteKey.
+     * @return the overwrite key
      */
-    public String getOverwriteKey()
-    {
+    public String getOverwriteKey() {
         return overwriteKey;
     }
 
     /**
      * @param overwriteKey
-     *            Set the context attribute key for the overwrite attribute.
+     *        the overwrite key to set
      */
-    public void setOverwriteKey(String overwriteKey)
-    {
+    public void setOverwriteKey(String overwriteKey) {
         this.overwriteKey = overwriteKey;
     }
 
     /**
-     * @return Returns the skipBinaryKey.
+     * @return the skip binary key
      */
-    public String getSkipBinaryKey()
-    {
+    public String getSkipBinaryKey() {
         return skipBinaryKey;
     }
 
     /**
      * @param skipBinaryKey
-     *            Set the context attribute key for the skipBinary attribute.
+     *        the skip binary key to set
      */
-    public void setSkipBinaryKey(String skipBinaryKey)
-    {
+    public void setSkipBinaryKey(String skipBinaryKey) {
         this.skipBinaryKey = skipBinaryKey;
     }
 
     /**
-     * @return Returns the fromKey.
+     * @return the from key
      */
-    public String getSrcAbsPathKey()
-    {
+    public String getSrcAbsPathKey() {
         return srcAbsPathKey;
     }
 
     /**
      * @param fromKey
-     *            The fromKey to set.
+     *        the from key to set
      */
-    public void setSrcAbsPathKey(String fromKey)
-    {
+    public void setSrcAbsPathKey(String fromKey) {
         this.srcAbsPathKey = fromKey;
     }
 
     /**
-     * @return Returns the toKey.
+     * @return the to key
      */
-    public String getDesFsPathKey()
-    {
+    public String getDesFsPathKey() {
         return desFsPathKey;
     }
 
     /**
      * @param toKey
-     *            The toKey to set.
+     *        the to key to set
      */
-    public void setDesFsPathKey(String toKey)
-    {
+    public void setDesFsPathKey(String toKey) {
         this.desFsPathKey = toKey;
     }
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public final boolean execute(Context ctx) throws Exception
-    {
+    public final boolean execute(Context ctx) throws Exception {
         boolean skipBinary = Boolean.valueOf(
             (String) ctx.get(this.skipBinaryKey)).booleanValue();
         boolean noRecurse = Boolean
             .valueOf((String) ctx.get(this.noRecurseKey)).booleanValue();
         String fromStr = (String) ctx.get(this.srcAbsPathKey);
-        if (log.isDebugEnabled())
-        {
+        if (log.isDebugEnabled()) {
             log.debug("exporting view from " + fromStr);
         }
         Node from = CommandHelper.getNode(ctx, fromStr);
@@ -197,9 +180,10 @@
 
     /**
      * Export the view to the given OutputStream
-     * 
      * @param node
+     *        the <code>Node</code>
      * @param out
+     *        the <code>OutputStream</code>
      * @param skipBinary
      * @param noRecurse
      * @throws RepositoryException

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportDocViewToFile.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportDocViewToFile.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportDocViewToFile.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportDocViewToFile.java
Tue Oct 11 07:38:54 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.jackrabbit.command.xml;
 
 import java.io.IOException;
@@ -8,16 +24,21 @@
 import javax.jcr.RepositoryException;
 
 /**
- * Serializes the node to the given file using the Document View Format
+ * Serialize the <code>Node</code> to the given file using the Document View
+ * Format
  */
-public class ExportDocViewToFile extends AbstractExportViewToFile
-{
+public class ExportDocViewToFile extends AbstractExportViewToFile {
 
-	protected void exportView(Node node, OutputStream out, boolean skipBinary,
-			boolean noRecurse) throws PathNotFoundException, IOException,
-			RepositoryException
-	{
-		node.getSession().exportDocumentView(node.getPath(), out, skipBinary,
-				noRecurse);
-	}
+    /**
+     * {@inheritDoc}
+     */
+    protected void exportView(
+        Node node,
+        OutputStream out,
+        boolean skipBinary,
+        boolean noRecurse) throws PathNotFoundException, IOException,
+            RepositoryException {
+        node.getSession().exportDocumentView(node.getPath(), out, skipBinary,
+            noRecurse);
+    }
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportSysViewToFile.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportSysViewToFile.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportSysViewToFile.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ExportSysViewToFile.java
Tue Oct 11 07:38:54 2005
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2004-2005 The Apache Software Foundation or its licensors,
+ *                     as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.jackrabbit.command.xml;
 
 import java.io.IOException;
@@ -8,20 +24,22 @@
 import javax.jcr.RepositoryException;
 
 /**
- * Serializes the node to the given file using the System View Format
+ * Serialize the <code>Node</code> to the given file using the System View
+ * Format
  */
-public class ExportSysViewToFile extends AbstractExportViewToFile
-{
+public class ExportSysViewToFile extends AbstractExportViewToFile {
 
-	/**
-	 * @inheritDoc
-	 */
-	protected void exportView(Node node, OutputStream out, boolean skipBinary,
-			boolean noRecurse) throws PathNotFoundException, IOException,
-			RepositoryException
-	{
-		node.getSession().exportSystemView(node.getPath(), out, skipBinary,
-				noRecurse);
-	}
+    /**
+     * {@inheritDoc}
+     */
+    protected void exportView(
+        Node node,
+        OutputStream out,
+        boolean skipBinary,
+        boolean noRecurse) throws PathNotFoundException, IOException,
+            RepositoryException {
+        node.getSession().exportSystemView(node.getPath(), out, skipBinary,
+            noRecurse);
+    }
 
 }

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ImportXmlFromFile.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ImportXmlFromFile.java?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ImportXmlFromFile.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/xml/ImportXmlFromFile.java
Tue Oct 11 07:38:54 2005
@@ -29,10 +29,9 @@
 import org.apache.jackrabbit.command.CommandHelper;
 
 /**
- * Imports the xml view from the given file to the current working node.
+ * Import the xml view from the given file to the current working <code>Node</code>
  */
-public class ImportXmlFromFile implements Command
-{
+public class ImportXmlFromFile implements Command {
 
     // ---------------------------- < keys >
 
@@ -46,21 +45,19 @@
     private String uuidBehaviourKey = "uuidBehaviour";
 
     /**
-     * @inheritDoc
+     * {@inheritDoc}
      */
-    public boolean execute(Context ctx) throws Exception
-    {
+    public boolean execute(Context ctx) throws Exception {
         String file = (String) ctx.get(this.srcFsPathKey);
         String dest = (String) ctx.get(this.destJcrPathKey);
         int uuidBehaviour = Integer.valueOf(
             (String) ctx.get(this.uuidBehaviourKey)).intValue();
         File f = new File(file);
-        if (!f.exists())
-        {
-            throw new CommandException("exception.file.not.found", new String[]
-            {
-                file
-            });
+        if (!f.exists()) {
+            throw new CommandException("exception.file.not.found",
+                new String[] {
+                    file
+                });
         }
         BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
         Session s = CommandHelper.getSession(ctx);
@@ -70,53 +67,47 @@
     }
 
     /**
-     * @return Returns the fromKey.
+     * @return the from key
      */
-    public String getSrcFsPathKey()
-    {
+    public String getSrcFsPathKey() {
         return srcFsPathKey;
     }
 
     /**
      * @param fromKey
-     *            Set the context attribute key for the from attribute.
+     *        the from key to set
      */
-    public void setSrcFsPathKey(String fromKey)
-    {
+    public void setSrcFsPathKey(String fromKey) {
         this.srcFsPathKey = fromKey;
     }
 
     /**
-     * @return Returns the uuidBehaviourKey.
+     * @return the uuidBehaviourKey
      */
-    public String getUuidBehaviourKey()
-    {
+    public String getUuidBehaviourKey() {
         return uuidBehaviourKey;
     }
 
     /**
      * @param uuidBehaviourKey
-     *            Set the context attribute key for the uuidBehaviour attribute.
+     *        the uuidBehaviourKey to set
      */
-    public void setUuidBehaviourKey(String uuidBehaviourKey)
-    {
+    public void setUuidBehaviourKey(String uuidBehaviourKey) {
         this.uuidBehaviourKey = uuidBehaviourKey;
     }
 
     /**
-     * @return Returns the destJcrPathKey.
+     * @return the destination jcr path key
      */
-    public String getDestJcrPathKey()
-    {
+    public String getDestJcrPathKey() {
         return destJcrPathKey;
     }
 
     /**
      * @param destJcrPathKey
-     *            The destJcrPathKey to set.
+     *        the destination jcr path key to set
      */
-    public void setDestJcrPathKey(String destJcrPathKey)
-    {
+    public void setDestJcrPathKey(String destJcrPathKey) {
         this.destJcrPathKey = destJcrPathKey;
     }
 }

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/changes.xml?rev=312896&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/changes.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/changes.xml Tue Oct 11 07:38:54
2005
@@ -0,0 +1,37 @@
+<document>
+    <properties>
+        <title>Changes</title>
+        <author email="edgarpoce@gmail.com">Edgar Poce</author>
+    </properties>
+    <body>
+        <release>
+            <action dev="edgarpoce" type="update"> javadocs and checkstyle
+                </action>
+            <action dev="edgarpoce" type="update"> naming and packaging
+                reviewed </action>
+            <action dev="edgarpoce" type="update"> now commands only read
+                parameters from the context because commands shouldn't have a
+                state of their own but use only the context. </action>
+            <action dev="edgarpoce" type="update"> i18n reorganized in one
+                single resources file </action>
+            <action dev="edgarpoce" type="add"> batch mode added </action>
+            <action dev="edgarpoce" type="add"> cover most of jcr operations
+                (versioning, locking, etc.) </action>
+            <action dev="edgarpoce" type="update"> commands simplified. Most
+                commands don't have default values. </action>
+            <action dev="edgarpoce" type="add"> logging added </action>
+            <action dev="edgarpoce" type="remove"> removed jmeter dependencies
+                </action>
+            <action dev="edgarpoce" type="add"> added command line interface
+                (o.a.j.chain.cli) </action>
+            <action dev="edgarpoce" type="add"> added CLI i18n support
+                </action>
+            <action dev="edgarpoce" type="add"> added info commands (ls,
+                cat, etc.) (o.a.j.chain.info) </action>
+            <action dev="edgarpoce" type="add"> added literal and context
+                attributes to commands </action>
+            <action dev="edgarpoce" type="add"> added testing </action>
+            <action dev="edgarpoce" type="add"> added javadocs </action>
+        </release>
+    </body>
+</document>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/changes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/index.xml?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/index.xml (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/index.xml Tue Oct 11 07:38:54 2005
@@ -16,24 +16,28 @@
    limitations under the License.
   -->
 <document>
-	<properties>
-		<title>Overview</title>
-	</properties>
-	<body>
-		<section name="Overview">
-			<p> JCR-commands contains a jcr command line client. It's backed by a set of
-				Apache Commons Chain commands that perform operations on any JCR compliant
-				repository. Moreover it includes a few commands jackrabbit specific to
-				cover some use cases that were not included in the specification.
-				<br/> For more information about using Commons Chain please refer to
-				http://jakarta.apache.org/commons/chain/ </p>
-		</section>
-		<section name="Usage scenarios">
-			<p>Perform any jcr operation either in interactive or batch mode.</p>
-			<p>Reuse the commands in applications through the Jakarta Commons Chains
-				library</p>
-			<p>Benchmarck any jcr compliant repository with jmeter by using
-				jmeter-command plugin.</p>
-		</section>
-	</body>
-</document>
+    <properties>
+        <title>Overview</title>
+    </properties>
+    <body>
+        <section name="Overview">
+            <p> This project contains a jcr command line client. It's backed by
+                a set of Apache Commons Chain commands that perform operations
+                on any JCR compliant repository. Moreover it includes a few
+                jackrabbit specific commands to cover some use cases that were
+                not included in the specification. <br/> For more information
+                about using Commons Chain please refer to
+                http://jakarta.apache.org/commons/chain/ </p>
+        </section>
+        <section name="Usage scenarios">
+            <ul>
+                <li>Perform jcr operations either in interactive or batch
+                    mode</li>
+                <li>Reuse the commands in applications through the Jakarta
+                    Commons Chains library</li>
+                <li>Benchmark any jcr compliant repository with jmeter-command
+                    plugin.</li>
+            </ul>
+        </section>
+    </body>
+</document>
\ No newline at end of file

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/navigation.xml?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/navigation.xml (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/navigation.xml Tue Oct 11 07:38:54
2005
@@ -17,11 +17,15 @@
   -->
 <project name="jcr-commands">
  <title>Jackrabbit - jcr-commands</title>
-	<body>
-		<menu name="JCR commands">
-			<item name="Overview" href="index.html" />
-			<item name="User guide" href="userguide.html" />
-			<item name="Developer guide" href="devguide.html" />
-		</menu>
-	</body>
+    <body>
+        <links>
+            <item name="Jackrabbit"
+                href="http://incubator.apache.org/jackrabbit"/>
+        </links>
+        <menu name="JCR commands">
+            <item name="Overview" href="index.html" />
+            <item name="User guide" href="userguide.html" />
+            <item name="Developer guide" href="devguide.html" />
+        </menu>
+    </body>
 </project>

Modified: incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/userguide.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/userguide.xml?rev=312896&r1=312895&r2=312896&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/userguide.xml (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/xdocs/userguide.xml Tue Oct 11 07:38:54
2005
@@ -16,18 +16,18 @@
    limitations under the License.
   -->
 <document>
-	<properties>
-		<title>User guide</title>
-	</properties>
-	<body>
-		<section name="Interactive mode">
-			<p></p>
-		</section>
-		<section name="Batch mode">
-			<p></p>
-		</section>
-		<section name="Benchmarcking jcr">
-			<p></p>
-		</section>		
-	</body>
+  <properties>
+    <title>User guide</title>
+  </properties>
+  <body>
+    <section name="Interactive mode">
+      <p>TODO</p>
+    </section>
+    <section name="Batch mode">
+      <p>TODO</p>
+    </section>
+    <section name="Benchmarcking jcr">
+      <p>TODO</p>
+    </section>
+  </body>
 </document>



Mime
View raw message