Return-Path: Delivered-To: apmail-incubator-jackrabbit-commits-archive@www.apache.org Received: (qmail 55504 invoked from network); 11 Oct 2005 14:42:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2005 14:42:03 -0000 Received: (qmail 80145 invoked by uid 500); 11 Oct 2005 14:42:00 -0000 Mailing-List: contact jackrabbit-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-commits@incubator.apache.org Received: (qmail 80025 invoked by uid 500); 11 Oct 2005 14:41:59 -0000 Delivered-To: apmail-incubator-jackrabbit-cvs@incubator.apache.org Received: (qmail 80013 invoked by uid 99); 11 Oct 2005 14:41:56 -0000 X-ASF-Spam-Status: No, hits=-8.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 11 Oct 2005 07:41:51 -0700 Received: (qmail 55267 invoked by uid 65534); 11 Oct 2005 14:41:30 -0000 Message-ID: <20051011144130.55265.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: jackrabbit-cvs@incubator.apache.org From: edgarpoce@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 Workspace key + */ + public String getSrcWorkspaceKey() { + return srcWorkspaceKey; + } + + /** + * @param srcWorkspaceKey + * the source Workspace 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 Version from the VersionHistory */ -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 Version from the VersionHistory 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 VersionHistory */ -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 Node to the state of the given Version */ -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 Node to the state of the Version 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 Node * @param out + * the OutputStream * @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 Node 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 Node 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 Node */ -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 @@ + + + Changes + Edgar Poce + + + + javadocs and checkstyle + + naming and packaging + reviewed + now commands only read + parameters from the context because commands shouldn't have a + state of their own but use only the context. + i18n reorganized in one + single resources file + batch mode added + cover most of jcr operations + (versioning, locking, etc.) + commands simplified. Most + commands don't have default values. + logging added + removed jmeter dependencies + + added command line interface + (o.a.j.chain.cli) + added CLI i18n support + + added info commands (ls, + cat, etc.) (o.a.j.chain.info) + added literal and context + attributes to commands + added testing + added javadocs + + + \ 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. --> - - Overview - - -
-

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. -
For more information about using Commons Chain please refer to - http://jakarta.apache.org/commons/chain/

-
-
-

Perform any jcr operation either in interactive or batch mode.

-

Reuse the commands in applications through the Jakarta Commons Chains - library

-

Benchmarck any jcr compliant repository with jmeter by using - jmeter-command plugin.

-
- -
+ + Overview + + +
+

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.
For more information + about using Commons Chain please refer to + http://jakarta.apache.org/commons/chain/

+
+
+
    +
  • Perform jcr operations either in interactive or batch + mode
  • +
  • Reuse the commands in applications through the Jakarta + Commons Chains library
  • +
  • Benchmark any jcr compliant repository with jmeter-command + plugin.
  • +
+
+ + \ 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 @@ --> Jackrabbit - jcr-commands - - - - - - - + + + + + + + + + + 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. --> - - User guide - - -
-

-
-
-

-
-
-

-
- + + User guide + + +
+

TODO

+
+
+

TODO

+
+
+

TODO

+
+