jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edgarp...@apache.org
Subject svn commit: r294914 [2/6] - in /incubator/jackrabbit/trunk/contrib/jcr-commands: ./ applications/test/ applications/test/fs/ benchmarking/ src/cli/ src/java/ src/java/META-INF/ src/java/org/apache/jackrabbit/chain/ src/java/org/apache/jackrabbit/comman...
Date Tue, 04 Oct 2005 20:54:30 GMT
Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line-rules.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line-rules.xml?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line-rules.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line-rules.xml Tue Oct  4 13:51:32 2005
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE digester-rules PUBLIC
+ "-//Jakarta Apache //DTD digester-rules XML V1.0//EN"
+ "digester-rules.dtd">
+<digester-rules>
+
+  <pattern value="commands/command">
+    <object-create-rule classname="org.apache.jackrabbit.command.cli.CommandLine"/>
+    <set-properties-rule/>
+	<call-method-rule pattern="alias" methodname="addAlias" paramcount="1" />
+	<call-param-rule pattern="alias" paramnumber="0" attrname="name"/>
+    <set-next-rule methodname="add" paramtype="java.lang.Object"/>
+  </pattern>
+
+  <pattern value="commands/command/argument">
+	<object-create-rule classname="org.apache.jackrabbit.command.cli.Argument" />
+	<set-next-rule methodname="addArgument" />
+    <set-properties-rule>
+		<alias attr-name="arg-name" prop-name="argName"/>
+		<alias attr-name="context-key" prop-name="contextKey"/>
+		<alias attr-name="default" prop-name="value"/>
+    </set-properties-rule>
+  </pattern>  
+  
+  <pattern value="commands/command/option">
+	<object-create-rule classname="org.apache.jackrabbit.command.cli.Option" />
+    <set-properties-rule>
+		<alias attr-name="arg-name" prop-name="argName"/>
+		<alias attr-name="context-key" prop-name="contextKey"/>
+		<alias attr-name="default" prop-name="value"/>
+    </set-properties-rule>
+	<set-next-rule methodname="addOption" />
+  </pattern>  
+
+  <pattern value="commands/command/flag">
+	<object-create-rule classname="org.apache.jackrabbit.command.cli.Flag" />
+    <set-properties-rule>
+		<alias attr-name="context-key" prop-name="contextKey"/>
+    </set-properties-rule>
+	<set-next-rule methodname="addFlag" />
+  </pattern>  
+  
+</digester-rules>

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line-rules.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line.xml?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line.xml Tue Oct  4 13:51:32 2005
@@ -0,0 +1,900 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE commands [
+	<!ELEMENT commands (command+)>
+
+	<!ELEMENT command (alias*, argument*, option*, flag*)>
+	<!ATTLIST command 
+	name NMTOKEN #REQUIRED 
+	description CDATA #IMPLIED
+	impl NMTOKEN #IMPLIED >
+
+	<!ELEMENT alias EMPTY>
+	<!ATTLIST alias
+		name NMTOKEN #REQUIRED>
+
+	<!ELEMENT option EMPTY>
+	<!ATTLIST option 
+		name NMTOKEN #REQUIRED 
+		context-key NMTOKEN #IMPLIED 
+		arg-name CDATA #IMPLIED
+		required NMTOKEN #IMPLIED 
+		default CDATA #IMPLIED 
+		description CDATA #IMPLIED>
+
+	<!ELEMENT argument EMPTY>
+	<!ATTLIST argument  
+		name NMTOKEN #REQUIRED 
+		context-key NMTOKEN #IMPLIED 
+		position NMTOKEN #REQUIRED 
+		arg-name CDATA #IMPLIED
+		required NMTOKEN #IMPLIED 
+		default CDATA #IMPLIED 
+		description CDATA #IMPLIED>
+
+	<!ELEMENT flag EMPTY>
+	<!ATTLIST flag
+		name NMTOKEN #REQUIRED 
+		context-key NMTOKEN #IMPLIED 
+		description CDATA #IMPLIED>
+		
+	]>
+<commands>
+
+	<command name="addlocktoken" impl="addLockToken">
+		<alias name="addtoken"/>
+		<argument 
+			name="token"
+			position="0"
+			required="true"/>
+	</command>
+		
+	<command name="addmixin" impl="addMixin">
+		<alias name="addmix"/>
+		<argument 
+			name="mixin"
+			position="0"
+			required="true"/>
+		<argument 
+			name="path"
+			position="1"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="addnode" impl="addNode">
+		<alias name="add"/>
+		<argument 
+			name="name" 
+			position="0"
+			context-key="relPath"
+			arg-name="common.jcrname" 
+			description="common.jcrname.desc" 
+			required="true"/>
+		<argument 
+			name="type"
+			position="1" 
+			arg-name="common.nodetype" 
+			description="common.nodetype.desc" />
+	</command>	
+	
+	<command name="addversionlabel" impl="addVersionLabel">
+		<alias name="addvlabel"/>
+		<argument name="version"
+			position="0" />
+		<argument name="label"
+			position="1" />
+		<option name="path" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+		<flag name="moveLabel"/>
+	</command>
+
+	<command name="cat">
+		<argument 
+			name="path" 
+			position="0" 
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"
+			required="true"/>
+		<argument 
+			name="idx" 
+			position="1" 
+			arg-name="common.index" 
+			description="common.index.desc"
+			context-key="index"/>
+	</command>	
+	
+	<command name="checkin">
+		<argument 
+			name="path"
+			position="0"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+	
+	<command name="checkout">
+		<argument 
+			name="path"
+			position="0"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="clearworkspace" impl="clearWorkspace">
+		<alias name="clear"/>
+	</command>
+
+	<command name="createworkspace" impl="createWorkspace">
+		<alias name="createw"/>
+		<argument 
+			name="name"
+			position="0"
+			required="true"/>
+	</command>
+		
+	<command name="clone">
+		<argument 
+			name="scrWorkspace"
+			position="0"
+			required="true"
+			arg-name="word.name"
+			description="common.source"/>
+		<argument 
+			name="srcAbsPath"
+			position="1"
+			required="true"/>
+		<argument 
+			name="destAbsPath"
+			position="2"
+			required="true"/>
+		<flag name="removeExisting"/>
+	</command>
+	
+	<command name="copy">
+		<argument 
+			name="srcAbsPath" 
+			position="0" 
+			arg-name="common.jcrabspath" 
+			required="true"/>
+		<argument 
+			name="destAbsPath" 
+			position="1" 
+			arg-name="common.jcrabspath" 
+			required="true"/>
+		<option 
+			name="fromWorkspace" 
+			context-key="srcWorkspace"/>
+	</command>	
+	
+	<command name="connect" impl="connectToRmiServer">
+		<argument 
+			name="url" 
+			position="0"
+			required="true"/>
+	</command>
+
+	<command name="currentnode" impl="currentNode">
+		<alias name="cd"/>
+		<alias name="cn"/>
+		<argument 
+			name="path" 
+			position="0"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"/>
+	</command>	
+
+	<command name="dump">	
+		<argument 
+			name="path" 
+			position="0" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+	
+	<command name="exportdocview" impl="exportDocViewToFile">
+		<alias name="exportdoc"/>
+		<argument 
+			name="srcAbsPath" 
+			position="0"
+			arg-name="common.jcrabspath" 
+			description="common.exportview.from"
+			required="true"/>
+		<argument 
+			name="desFsPath" 
+			position="1"
+			arg-name="common.fspath" 
+			description="common.exportview.to"
+			required="true"/>
+		<flag 
+			name="overwrite" 
+			description="word.overwrite"/>
+		<flag
+			name="skipBinary" 
+			description="common.exportview.skipBinary" />
+		<flag 
+			name="noRecurse" 
+			description="common.exportview.noRecurse"/>
+	</command>	
+	
+	<command name="exportfilesystem" impl="exportFileSystem">
+		<alias name="exportfs"/>
+		<argument
+			name="srcJcrPath"
+			position="0"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"
+			required="true"/>
+		<argument
+			name="destFsPath" 
+			position="1"
+			arg-name="common.fspath" 
+			description="word.destination"
+			required="true"/>
+		<flag name="overwrite"
+			description="word.overwrite"/>
+	</command>
+
+	<command name="exportproperty" impl="exportPropertyToFile">
+		<alias name="exportprop"/>
+		<alias name="exportp"/>
+		<argument 
+			name="name"
+			position="0" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"
+			required="true"/>
+		<argument 
+			name="destFsPath" 
+			position="1"
+			arg-name="common.fspath" 
+			description="common.fspath.desc"
+			required="true"/>
+		<option 
+			name="idx" 
+			arg-name="common.index" 
+			description="common.index.desc"
+			context-key="index"/>
+		<flag 
+			name="overwrite" 
+			description="word.overwrite"/>
+	</command>	
+			
+	<command name="exportsysview" impl="exportSysViewToFile">
+		<alias name="exportsys"/>
+		<argument 
+			name="srcAbsPath" 
+			position="0"
+			arg-name="common.jcrabspath" 
+			description="common.exportview.from"
+			required="true"/>
+		<argument 
+			name="desFsPath" 
+			position="1"
+			arg-name="common.fspath" 
+			description="common.exportview.to"
+			required="true"/>
+		<flag 
+			name="overwrite" 
+			description="word.overwrite"/>
+		<flag
+			name="skipBinary" 
+			description="common.exportview.skipBinary"/>
+		<flag 
+			name="noRecurse" 
+			description="common.exportview.noRecurse"/>
+	</command>	
+	
+	<command name="help">
+		<argument 
+			name="command" 
+			position="0"
+			required="false" />
+	</command>
+
+	<command name="importfilesystem" impl="importFileSystem">
+		<alias name="importfs"/>
+		<argument 
+			name="srcFsPath"
+			position="0" 
+			arg-name="common.fspath" 
+			description="common.fspath.desc" 
+			required="true"/>
+	</command>	
+
+	<command name="importxml" impl="importXmlFromFile">
+		<alias name="import"/>
+		<argument 
+			name="srcFsPath" 
+			position="0"
+			arg-name="common.fspath" 
+			description="common.fspath.desc" 
+			required="true"/>
+		<argument 
+			name="destJcrPath" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"
+			position="1"/>
+		<option 
+			name="uuidBehaviour" 
+			arg-name="common.uuidBehaviour"
+			description="common.uuidBehaviour.desc"
+			default="0"/>
+	</command>		
+
+	<command name="lock">
+		<argument 
+			name="path" 
+			position="0" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+		<flag name="deep"/>
+		<flag name="session" context-key="sessionScoped"/>
+	</command>	
+			
+	<command name="login">
+		<argument 
+			name="user"
+			position="0"
+			arg-name="word.user"
+			default="anonymous"/>
+		<argument 
+			name="password"
+			position="1"
+			arg-name="word.password"
+			default="anonymous"/>
+		<option 
+			name="workspace" 
+			arg-name="word.name"/>
+	</command>
+	
+	<command name="logout"/>		
+
+	<command name="lscollect" impl="lsCollect">
+		<alias name="collect"/>
+		<argument 
+			name="pattern" 
+			position="0" 
+			arg-name="common.namepattern" 
+			description="common.namepattern.desc" 
+			required="true"/>
+		<option 
+			name="path" 
+			context-key="srcPath"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+		<option 
+			name="depth" 
+			arg-name="word.int" 
+			description="word.int"
+			default="1"/>
+		<option 
+			name="maxItems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+	</command>	
+
+	<command name="lscollectnodes" impl="lsCollectNodes">
+		<alias name="lscollectn"/>
+		<alias name="collectn"/>
+		<argument 
+			name="pattern" 
+			position="0" 
+			arg-name="common.namepattern"
+			description="common.namepattern.desc" 
+			required="true"/>
+		<option 
+			name="depth" 
+			arg-name="word.int" 
+			description="word.int"
+			default="1"/>
+		<option 
+			name="maxItems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+		<flag name="uuid" description="cmd.lsnodes.uuid"/>
+		<flag name="nsize" description="cmd.lsnodes.nsize"/>
+		<flag name="psize" description="cmd.lsnodes.psize"/>
+		<flag name="rsize" description="cmd.lsnodes.rsize"/>
+		<flag name="m" description="cmd.lsnodes.m"/>
+		<flag name="v" description="cmd.lsnodes.v"/>
+		<flag name="l" description="cmd.lsnodes.l"/>
+		<flag name="r" description="cmd.lsnodes.r"/>
+		<flag name="locked" description="cmd.lsnodes.locked"/>
+		<flag name="hasLock" description="cmd.lsnodes.hasLock"/>
+		<flag name="locktoken" 
+			context-key="lockToken" 
+			description="cmd.lsnodes.locktoken"/>
+		<flag name="new" description="cmd.lsnodes.new"/>
+		<flag name="mod" description="cmd.lsnodes.mod"/>
+		<flag name="path" description="cmd.lsnodes.path"/>
+	</command>	
+	
+	<command name="lscollectproperties" impl="lsCollectProperties">
+		<alias name="collectp"/>
+		<alias name="collectprop"/>
+		<argument 
+			name="pattern" 
+			position="0" 
+			arg-name="common.namepattern" 
+			description="common.namepattern.desc"
+			required="true"/>
+		<option 
+			name="depth" 
+			arg-name="word.depth" 
+			description="word.depth"
+			default="1"/>
+		<option 
+			name="maxitems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+	</command>	
+	
+	<command name="lsitems" impl="lsItems">
+		<alias name="ls"/>
+		<argument 
+			name="pattern" 
+			position="0"
+			arg-name="common.namepattern" 
+			description="common.namepattern.desc"/>
+		<option
+			name="maxItems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+	</command>
+	
+	<command name="lsproperties" impl="lsProperties">
+		<alias name="lsp"/>
+		<alias name="lsprop"/>
+		<argument 
+			name="pattern" 
+			position="0"
+			arg-name="common.namepattern" 
+			description="common.namepattern.desc"/>
+		<option 
+			name="maxItems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+	</command>		
+	
+	<command name="lsnodes" impl="lsNodes">
+		<alias name="lsn"/>
+		<argument 
+			name="pattern" 
+			position="0"
+			arg-name="common.namepattern" 
+			description="common.namepattern.desc"/>
+		<option 
+			name="maxItems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+		<flag name="path" description="cmd.lsnodes.path"/>
+		<flag name="uuid" description="cmd.lsnodes.uuid"/>
+		<flag name="m" context-key="mixin" description="cmd.lsnodes.m"/>
+		<flag name="nsize" context-key="nodeSize" description="cmd.lsnodes.nsize"/>
+		<flag name="psize" context-key="propertiesSize" description="cmd.lsnodes.psize"/>
+		<flag name="rsize" context-key="referencesSize" description="cmd.lsnodes.rsize"/>
+		<flag name="v" context-key="versionable" description="cmd.lsnodes.v"/>
+		<flag name="l" context-key="lockable" description="cmd.lsnodes.l"/>
+		<flag name="r" context-key="referenceable" description="cmd.lsnodes.r"/>
+		<flag name="locked" description="cmd.lsnodes.locked"/>
+		<flag name="haslock" context-key="hasLock" description="cmd.lsnodes.hasLock"/>
+		<flag name="locktoken" context-key="lockToken"/>
+		<flag name="new" description="cmd.lsnodes.new"/>
+		<flag name="mod" context-key="modified" description="cmd.lsnodes.mod"/>
+	</command>	
+
+	<command name="lsreferences" impl="lsReferences">
+		<alias name="lsr"/>
+		<alias name="lsref"/>
+		<argument 
+			name="path" 
+			position="0"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="lsversions" impl="lsVersions">
+		<alias name="lsv"/>
+		<alias name="lsver"/>
+		<argument 
+			name="path" 
+			position="0"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="merge">
+		<argument 
+			name="srcWorkspace"
+			arg-name="word.source"
+			description="word.source"
+			position="0" />
+		<argument name="path"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"
+			position="1" />
+		<flag name="bestEffort"/>
+	</command>
+	
+	<command name="move">
+		<argument 
+			name="srcAbsPath" 
+			position="0" 
+			arg-name="common.jcrabspath" 
+			description="common.jcrabspath.desc"
+			required="true"/>
+		<argument 
+			name="destAbsPath" 
+			position="1" 
+			arg-name="common.jcrabspath" 
+			description="common.jcrabspath.desc"
+			required="true"/>
+	</command>	
+
+	<command name="orderbefore" impl="orderBefore">
+		<alias name="order"/>
+		<argument 
+			name="srcChild" 
+			position="0" 
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"
+			required="true"/>
+		<argument 
+			name="destChild" 
+			position="1" 
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"
+			required="true"/>
+		<option
+			name="parent" 
+			context-key="parentPath"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"/>			
+	</command>		
+	
+	<command name="refresh">
+		<argument 
+			name="path" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"
+			position="0"/>
+		<flag name="keepChanges" description="phrase.keepchanges"/>
+	</command>
+
+	<command name="refreshlock" impl="refreshLock">
+		<alias name="refreshl"/>
+		<argument 
+			name="path" 
+			position="0" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>	
+
+	<command name="registernamespace" impl="registerNamespace">
+		<argument 
+			name="prefix" 
+			position="0" 
+			arg-name="word.prefix"
+			description="word.prefix"/>
+		<argument 
+			name="uri" 
+			position="1" 
+			arg-name="word.uri"
+			description="word.uri"/>
+	</command>	
+		
+	<command name="removeitem" impl="removeItem">
+		<alias name="remove"/>
+		<alias name="delete"/>
+		<alias name="rm"/>
+		<alias name="del"/>
+		<argument 
+			name="path"
+			position="0" 
+			arg-name="common.jcrpath" 
+			description="common.jcrpath"/>
+	</command>	
+
+	<command name="removeitems" impl="removeItems">
+		<alias name="rmitems"/>
+		<alias name="delitems"/>
+		<alias name="deleteitems"/>
+		<argument 
+			name="pattern" 
+			position="0"
+			arg-name="common.namepattern" 
+			description="common.namepattern.desc" 
+			required="true"/>
+		<option 
+			name="root"
+			context-key="path"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"/>
+	</command>		
+
+	<command name="removelocktoken" impl="removeLockToken">
+		<alias name="removetoken"/>
+		<argument 
+			name="token"
+			position="0"
+			arg-name="phrase.locktoken" 
+			description="phrase.locktoken"
+			required="true"/>
+	</command>
+
+	<command name="removemixin" impl="removeMixin">
+		<alias name="removemix"/>
+		<alias name="deletemix"/>
+		<alias name="delmix"/>
+		<argument 
+			name="mixin"
+			position="0"
+			arg-name="word.mixin" 
+			description="word.mixin"
+			required="true"/>
+		<argument 
+			name="path"
+			position="1"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+	
+	<command name="removeversion" impl="removeVersion">
+		<alias name="removev"/>
+		<argument name="name"
+			position="0" 
+			arg-name="word.name"
+			description="word.name"/>
+		<option name="path"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="removeversionlabel" impl="removeVersionLabel">
+		<alias name="removevlabel"/>
+		<alias name="delvlabel"/>
+		<argument name="label"
+			arg-name="word.label"
+			description="word.label"
+			position="0" />
+		<option name="path"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+								
+	<command name="removeversionbylabel" impl="removeVersionByLabel">
+		<alias name="removevbylabel"/>
+		<alias name="delvbylabel"/>
+		<alias name="removevbyl"/>
+		<alias name="delvbyl"/>
+		<argument name="label"
+			arg-name="word.label"
+			description="word.label"
+			position="0" />
+		<option name="path"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="rename">
+		<argument 
+			name="srcPath" 
+			position="0" 
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"
+			required="true"/>
+		<argument 
+			name="destPath" 
+			position="1" 
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"
+			required="true"/>
+	</command>	
+
+	<command name="restore">
+		<argument name="version"
+			position="0" 
+			arg-name="word.version"
+			description="word.version"/>
+		<option name="path"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+		<flag name="removeexisting" 
+			context-key="removeExisting"
+			description="phrase.removeExisting"/>
+	</command>
+
+	<command name="restorebylabel" impl="restoreByLabel">
+		<alias name="restorebyl"/>
+		<argument name="label"
+			arg-name="word.label"
+			description="word.label"
+			position="0" />
+		<option name="path"
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+		<flag name="removeexisting" 
+			context-key="removeExisting"
+			description="phrase.removeExisting"/>
+	</command>
+
+	<command name="save">	
+		<argument 
+			name="path" 
+			position="0"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="setmultivalueproperty" impl="setMultiValueProperty">
+		<alias name="setmultiprop"/>
+		<argument 
+			name="name" 
+			position="0"
+			arg-name="word.name" 
+			description="word.name" 
+			required="true"/>
+		<argument 
+			name="value" 
+			position="1"
+			arg-name="word.value" 
+			description="word.value" 
+			required="true"/>
+		<option 
+			name="type" 
+			arg-name="common.nodetype" 
+			description="common.nodetype.desc" />
+		<option 
+			name="regexp" 
+			context-key="regExp"
+			arg-name="phrase.regexp"
+			description="phrase.regexp"
+			default=","/>
+	</command>		
+		
+	<command name="setproperty" impl="setProperty">
+		<alias name="setprop"/>
+		<alias name="setp"/>
+		<argument 
+			name="name" 
+			position="0"
+			arg-name="word.name" 
+			description="word.name" 
+			required="true"/>
+		<argument 
+			name="value" 
+			position="1"
+			arg-name="word.value" 
+			description="word.value" 
+			required="true"/>
+		<option 
+			name="type" 
+			arg-name="common.nodetype" 
+			description="common.nodetype.desc" />
+		<option 
+			name="parent" 
+			context-key="parentPath"
+			arg-name="common.jcrpath" 
+			description="common.jcrpath.desc" />			
+	</command>		
+
+	<command name="setpropertyfromfile" impl="setPropertyFromFile">
+		<alias name="setpropfromfile"/>
+		<alias name="setfsprop"/>
+		<argument 
+			name="name" 
+			position="0"
+			arg-name="word.name" 
+			description="word.name" 
+			required="true"/>
+		<argument 
+			name="fsPath" 
+			position="1"
+			arg-name="common.fspath" 
+			description="common.fspath.desc"
+			context-key="value"
+			required="true"/>
+		<option 
+			name="type" 
+			arg-name="common.nodetype" 
+			description="common.nodetype"/>
+		<option 
+			name="parentPath" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+			
+	<command name="source">
+		<argument 
+			name="file" 
+			position="0" 
+			arg-name="common.fspath" 
+			description="common.fspath.desc"
+			required="true"/>
+	</command>
+
+	<command name="sqlquery" impl="sqlQuery">
+		<alias name="sql"/>
+		<argument 
+			name="statement" 
+			position="0"
+			arg-name="word.stmt" 
+			description="word.stmt"
+			required="true"/>
+		<option 
+			name="maxitems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+		<flag name="uuid" description="cmd.lsnodes.uuid"/>
+		<flag name="nsize" description="cmd.lsnodes.nsize"/>
+		<flag name="psize" description="cmd.lsnodes.psize"/>
+		<flag name="rsize" description="cmd.lsnodes.rsize"/>
+		<flag name="m" description="cmd.lsnodes.m"/>
+		<flag name="v" description="cmd.lsnodes.v"/>
+		<flag name="l" description="cmd.lsnodes.l"/>
+		<flag name="r" description="cmd.lsnodes.r"/>
+		<flag name="locked" description="cmd.lsnodes.locked"/>
+		<flag name="hasLock" description="cmd.lsnodes.hasLock"/>
+		<flag name="new" description="cmd.lsnodes.new"/>
+		<flag name="mod" description="cmd.lsnodes.mod"/>
+		<flag name="path" description="cmd.lsnodes.path"/>		
+		<flag name="locktocken" description="cmd.lsnodes.locktoken"/>
+	</command>
+	
+	<command name="startjackrabbit" impl="startJackrabbit">
+		<alias name="start"/>
+		<argument
+			name="config" 
+			position="0"
+			arg-name="common.fspath" 
+			description="common.fspath.desc"
+			required="true"/>
+		<argument
+			name="home" 
+			position="1"
+			arg-name="common.fspath" 
+			description="common.fspath.desc"
+			required="true"/>
+	</command>
+	
+	<command name="stopjackrabbit" impl="stopJackrabbit">	
+		<alias name="stop"/>
+	</command>
+	
+	<command name="unlock">
+		<argument 
+			name="path" 
+			position="0" 
+			arg-name="common.jcrpath"
+			description="common.jcrpath.desc"/>
+	</command>
+
+	<command name="xpathquery" impl="xpathQuery">
+		<alias name="xpath"/>
+		<argument 
+			name="statement" 
+			position="0"
+			arg-name="word.stmt" 
+			description="word.stmt"
+			required="true"/>
+		<option 
+			name="maxitems" 
+			arg-name="word.int" 
+			description="phrase.maxitems"/>
+		<flag name="uuid" description="cmd.lsnodes.uuid"/>
+		<flag name="nsize" description="cmd.lsnodes.nsize"/>
+		<flag name="psize" description="cmd.lsnodes.psize"/>
+		<flag name="rsize" description="cmd.lsnodes.rsize"/>
+		<flag name="m" description="cmd.lsnodes.m"/>
+		<flag name="v" description="cmd.lsnodes.v"/>
+		<flag name="l" description="cmd.lsnodes.l"/>
+		<flag name="r" description="cmd.lsnodes.r"/>
+		<flag name="locked" description="cmd.lsnodes.locked"/>
+		<flag name="hasLock" description="cmd.lsnodes.hasLock"/>
+		<flag name="new" description="cmd.lsnodes.new"/>
+		<flag name="mod" description="cmd.lsnodes.mod"/>
+		<flag name="path" description="cmd.lsnodes.path"/>		
+		<flag name="locktoken" description="cmd.lsnodes.locktoken"/>
+	</command>
+			
+</commands>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml Tue Oct  4 13:51:32 2005
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<chains>
+	<catalog>
+
+		<command name="addMixin"
+			className="org.apache.jackrabbit.command.mixin.AddMixin"/>
+
+		<command name="addNode"
+			className="org.apache.jackrabbit.command.core.AddNode"/>
+					
+		<command name="addLockToken"
+			className="org.apache.jackrabbit.command.lock.AddLockToken"/>
+
+		<command name="addVersionLabel"
+			className="org.apache.jackrabbit.command.version.AddVersionLabel"/>
+
+		<command name="cat"
+			className="org.apache.jackrabbit.command.info.Cat"/>
+
+		<command name="checkin"
+			className="org.apache.jackrabbit.command.version.Checkin"/>
+
+		<command name="checkout"
+			className="org.apache.jackrabbit.command.version.Checkout"/>
+
+		<command name="clearWorkspace"
+			className="org.apache.jackrabbit.command.core.ClearWorkspace"/>
+
+		<command name="clone"
+			className="org.apache.jackrabbit.command.core.Clone"/>
+
+		<command name="collectItems"
+			className="org.apache.jackrabbit.command.collect.CollectItems"/>
+
+		<command name="collectNodes"
+			className="org.apache.jackrabbit.command.collect.CollectNodes"/>
+
+		<command name="collectProperties"
+			className="org.apache.jackrabbit.command.collect.CollectProperties"/>
+
+		<command name="connectToRmiServer"
+			className="org.apache.jackrabbit.command.ext.ConnectToRmiServer"/>
+
+		<command name="copy"
+			className="org.apache.jackrabbit.command.core.Copy"/>
+
+		<command name="createWorkspace"
+			className="org.apache.jackrabbit.command.ext.CreateWorkspace"/>
+
+		<command name="currentNode"
+			className="org.apache.jackrabbit.command.core.CurrentNode"/>
+
+		<command name="describe"
+			className="org.apache.jackrabbit.command.info.Describe"/>
+
+		<command name="dump"
+			className="org.apache.jackrabbit.command.info.Dump"/>
+
+		<command name="exportFileSystem"
+			className="org.apache.jackrabbit.command.fs.ExportFileSystem"/>
+
+		<command name="exportPropertyToFile"
+			className="org.apache.jackrabbit.command.fs.ExportPropertyToFile"/>
+
+		<command name="exportDocViewToFile"
+			className="org.apache.jackrabbit.command.xml.ExportDocViewToFile"/>
+
+		<command name="exportSysViewToFile"
+			className="org.apache.jackrabbit.command.xml.ExportSysViewToFile"/>
+
+		<command name="help"
+			className="org.apache.jackrabbit.command.info.Help"/>
+
+		<command name="importFileSystem"
+			className="org.apache.jackrabbit.command.fs.ImportFileSystem"/>
+
+		<command name="importXmlFromFile"
+			className="org.apache.jackrabbit.command.xml.ImportXmlFromFile"/>
+
+		<command name="lock"
+			className="org.apache.jackrabbit.command.lock.Lock"/>
+
+		<command name="login"
+			className="org.apache.jackrabbit.command.core.Login"/>
+
+		<command name="logout"
+			className="org.apache.jackrabbit.command.core.Logout"/>
+			
+		<chain name="lsCollect">
+			<command name="collectItems"
+				className="org.apache.jackrabbit.command.collect.CollectItems"
+				destKey="collected"/>
+			<command name="lsCollectedItems"
+				className="org.apache.jackrabbit.command.info.LsCollectedItems"
+				fromKey="collected"/>
+			<command name="remove"
+				className="org.apache.commons.chain.generic.RemoveCommand"
+				fromKey="collected"/>
+		</chain>
+		
+		<chain name="lsCollectNodes">
+			<command name="collectNodes"
+				className="org.apache.jackrabbit.command.collect.CollectNodes"
+				destKey="collected"/>
+			<command name="lsCollectedNodes"
+				className="org.apache.jackrabbit.command.info.LsCollectedNodes"
+				fromKey="collected"/>
+			<command name="remove"
+				className="org.apache.commons.chain.generic.RemoveCommand"
+				fromKey="collected"/>
+		</chain>
+		
+		<chain name="lsCollectProperties">
+			<command name="collectProperties"
+				className="org.apache.jackrabbit.command.collect.CollectProperties"
+				destKey="collected"/>
+			<command name="lsCollectedNodes"
+				className="org.apache.jackrabbit.command.info.LsCollectedProperties"
+				fromKey="collected"/>
+			<command name="remove"
+				className="org.apache.commons.chain.generic.RemoveCommand"
+				fromKey="collected"/>
+		</chain>
+
+		<command name="lsCollectedItems"
+			className="org.apache.jackrabbit.command.info.LsCollectedItems"/>
+
+		<command name="lsCollectedNodes"
+			className="org.apache.jackrabbit.command.info.LsCollectedNodes"/>
+
+		<command name="lsCollectedItems"
+			className="org.apache.jackrabbit.command.info.LsCollectedProperties"/>
+
+		<command name="lsItems"
+			className="org.apache.jackrabbit.command.info.LsItems"/>
+
+		<command name="lsNamespaces"
+			className="org.apache.jackrabbit.command.info.LsNamespaces"/>
+
+		<command name="lsNodes"
+			className="org.apache.jackrabbit.command.info.LsNodes"/>
+
+		<command name="lsProperties"
+			className="org.apache.jackrabbit.command.info.LsProperties"/>
+
+		<command name="lsReferences"
+			className="org.apache.jackrabbit.command.info.LsReferences"/>
+
+		<command name="lsVersions"
+			className="org.apache.jackrabbit.command.info.LsVersions"/>
+
+		<command name="merge"
+			className="org.apache.jackrabbit.command.version.Merge"/>
+
+		<command name="move"
+			className="org.apache.jackrabbit.command.core.Move"/>
+
+		<command name="orderBefore"
+			className="org.apache.jackrabbit.command.core.OrderBefore"/>
+
+		<command name="readValue"
+			className="org.apache.jackrabbit.command.core.ReadValue"/>
+
+		<command name="refresh"
+			className="org.apache.jackrabbit.command.core.Refresh"/>
+
+		<command name="refreshLock"
+			className="org.apache.jackrabbit.command.lock.RefreshLock"/>
+
+		<command name="registerNamespace"
+			className="org.apache.jackrabbit.command.namespace.RegisterNamespace"/>
+
+		<command name="removeItem"
+			className="org.apache.jackrabbit.command.core.RemoveItem"/>
+						
+		<command name="removeItems"
+			className="org.apache.jackrabbit.command.core.RemoveItems"/>
+			
+		<command name="removeLock"
+			className="org.apache.jackrabbit.command.lock.RemoveLockToken"/>
+
+		<command name="removeLockToken"
+			className="org.apache.jackrabbit.command.lock.RemoveLockToken"/>
+
+		<command name="removeMixin"
+			className="org.apache.jackrabbit.command.mixin.RemoveMixin"/>
+
+		<command name="removeVersion"
+			className="org.apache.jackrabbit.command.version.RemoveVersion"/>
+
+		<command name="removeVersionByLabel"
+			className="org.apache.jackrabbit.command.version.RemoveVersionByLabel"/>
+		
+		<command name="removeVersionLabel"
+			className="org.apache.jackrabbit.command.version.RemoveVersionLabel"/>
+
+		<command name="rename"
+			className="org.apache.jackrabbit.command.core.Rename"/>
+
+		<command name="restore"
+			className="org.apache.jackrabbit.command.version.Restore"/>
+
+		<command name="restoreByLabel"
+			className="org.apache.jackrabbit.command.version.RestoreByLabel"/>
+
+		<command name="save"
+			className="org.apache.jackrabbit.command.core.Save"/>
+
+		<command name="setMultiValueProperty"
+			className="org.apache.jackrabbit.command.core.SetMultivalueProperty"/>
+
+		<command name="setProperty"
+			className="org.apache.jackrabbit.command.core.SetProperty"/>
+			
+		<command name="setPropertyFromFile"
+			className="org.apache.jackrabbit.command.fs.SetPropertyFromFile"/>
+
+		<command name="source"
+			className="org.apache.jackrabbit.command.cli.SourceCommand"/>
+
+		<chain name="sqlQuery">
+			<command name="sqlQuery"
+				className="org.apache.jackrabbit.command.query.SQLQuery"
+				destKey="collected"/>
+			<command name="lsCollectedItems"
+				className="org.apache.jackrabbit.command.info.LsCollectedItems"
+				fromKey="collected"/>
+			<command name="remove"
+				className="org.apache.commons.chain.generic.RemoveCommand"
+				fromKey="collected"/>
+		</chain>
+
+		<command name="startJackrabbit"
+			className="org.apache.jackrabbit.command.ext.StartJackrabbit"/>
+
+		<command name="startJackrabbitSingleton"
+			className="org.apache.jackrabbit.command.ext.StartJackrabbitSingleton"/>
+						
+		<command name="stopJackrabbit"
+			className="org.apache.jackrabbit.command.ext.StopJackrabbit"/>
+
+		<command name="unlock"
+			className="org.apache.jackrabbit.command.lock.Unlock"/>
+
+		<command name="unregisterNamespace"
+			className="org.apache.jackrabbit.command.namespace.UnregisterNamespace"/>
+
+		<chain name="xpathQuery">
+			<command name="xpathQuery"
+				className="org.apache.jackrabbit.command.query.XPathQuery"
+				destKey="collected"/>
+			<command name="lsCollectedItems"
+				className="org.apache.jackrabbit.command.info.LsCollectedItems"
+				fromKey="collected"/>
+			<command name="remove"
+				className="org.apache.commons.chain.generic.RemoveCommand"
+				fromKey="collected"/>
+		</chain>
+
+	</catalog>
+</chains>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/digester-rules.dtd
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/digester-rules.dtd?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/digester-rules.dtd (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/digester-rules.dtd Tue Oct  4 13:51:32 2005
@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- $Id: digester-rules.dtd 155412 2005-02-26 12:58:36Z dirkv $
+  
+ Copyright 2001-2005 The Apache Software Foundation.
+ 
+ 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.
+--> 
+
+<!--
+        "Digester" component of the Jakarta Commons Subproject
+        DTD for the definition of Digester rules in XML.
+        $Id: digester-rules.dtd 155412 2005-02-26 12:58:36Z dirkv $
+
+        Applications wishing to reference this DTD in their own documents
+        should use the following DOCTYPE declaration:
+
+        <!DOCTYPE digester-rules PUBLIC
+         "-//Jakarta Apache //DTD digester-rules XML V1.0//EN"
+         "digester-rules.dtd">
+
+-->
+
+<!-- This document type defines an XML format for defining Digester rules.
+     Digester is a framework for pattern-matching-based parsing of XML into
+     Java objects. See http://jakarta.apache.org/commons/digester.html.  -->
+
+<!ENTITY % rule-elements "bean-property-setter-rule | call-method-rule |
+                   call-param-rule | object-param-rule |
+                   factory-create-rule | object-create-rule |
+                   set-properties-rule | set-nested-properties-rule |
+                   set-property-rule | set-top-rule |
+                   set-next-rule | set-root-rule" >
+
+<!-- digester-rules is the root element. -->
+<!ELEMENT digester-rules (pattern | include | %rule-elements; )*>
+
+
+<!-- <pattern> defines a matching pattern, or part of a matching pattern. Any
+     rule nested in a pattern element prepends its parent's to its pattern.
+     Patterns may be recursively nested.
+     Example:
+       <pattern value="foo">
+          <pattern value="bar">
+            <object-create-rule pattern="baz" classname="Fubar" />
+          </pattern>
+       </pattern>
+
+     The above sample fragment defines an ObjectCreateRule associated
+     with the pattern "foo/bar/baz".
+
+  Note that the use of pattern elements is optional; an alternative is for
+  each rule element to contain a 'pattern' attribute.   -->
+<!ELEMENT pattern (pattern | include | %rule-elements; )*>
+<!ATTLIST pattern
+    value CDATA #REQUIRED>
+
+
+<!--
+  <include> allows one set of digester rules to be included inside
+  another. The 'path' attribute contains the URI of the document to
+  include. Inclusion behaves as if the included rules document is
+  'macro-expanded' within the outer document.
+  Programmatically initialized rules can be included as well, via the
+  'class' attribute. The 'class' attribute should contain the name
+  of a class that implements
+  org.apache.commons.digester.xmlrules.DigesterRulesSource.
+-->
+<!ELEMENT include EMPTY>
+<!ATTLIST include
+    path  CDATA #IMPLIED
+    class CDATA #IMPLIED>
+
+
+<!-- Each 'rule' element below corresponds to a concrete subclass
+     of org.apache.framework.digester.Rule.
+     Each 'rule' element has an optional 'pattern' attribute, which
+     defines the pattern for that rule instance. If the rule element
+     is nested inside one or more <pattern> elements, those patterns
+     will be prepended to the pattern specified in the rule's 'pattern'
+     attribute. -->
+
+<!-- Bean Property Setter Rule -->
+<!ELEMENT bean-property-setter-rule EMPTY>
+<!ATTLIST bean-property-setter-rule
+    pattern      CDATA #IMPLIED
+    propertyname CDATA #IMPLIED>
+
+<!-- CallMethodRule
+  -
+  - Note that paramtypes is ignored unless paramcount is defined.
+  -->
+<!ELEMENT call-method-rule EMPTY>
+<!ATTLIST call-method-rule
+    pattern      CDATA #IMPLIED
+    targetoffset CDATA #IMPLIED
+    methodname   CDATA #REQUIRED
+    paramcount   CDATA #IMPLIED
+    paramtypes   CDATA #IMPLIED>
+
+<!-- 
+    CallParamRule 
+    attrname - set param from attribute value (cannot be combined with from-stack)
+    from-stack - set param from stack (cannot be combined with attrname)
+    -->
+<!ELEMENT call-param-rule EMPTY>
+<!ATTLIST call-param-rule
+    pattern  CDATA #IMPLIED
+    paramnumber CDATA #REQUIRED
+    attrname CDATA #IMPLIED
+    from-stack CDATA #IMPLIED
+    stack-index CDATA #IMPLIED>
+    
+<!--
+    ObjectParamRule
+    attrname  
+           - an arbitrary Object defined programatically, assigned if the 
+             element pattern AND specified attribute name are matched
+    param 
+           - an arbitrary Object defined programatically, assigned when the 
+             element pattern associated with the Rule is matched
+    type 
+           - class name for object
+    value 
+           - initial value for the object
+    -->
+<!ELEMENT object-param-rule EMPTY>
+<!ATTLIST object-param-rule
+    pattern  CDATA #IMPLIED
+    paramnumber CDATA #REQUIRED
+    param CDATA #REQUIRED
+    attrname CDATA #IMPLIED
+    type CDATA #REQUIRED
+    value CDATA #IMPLIED>
+
+<!-- 
+    FactoryCreateRule 
+    
+    ignore-exceptions - if this attribute is (ignore case) 'true' then any exceptions
+                        thrown by the object create rule will be ignore.
+                        This will allow processing to continue.
+    -->
+<!ELEMENT factory-create-rule EMPTY>
+<!ATTLIST factory-create-rule
+    pattern   CDATA #IMPLIED
+    classname CDATA #REQUIRED
+    attrname  CDATA #IMPLIED
+    ignore-exceptions  CDATA #IMPLIED> 
+
+<!-- ObjectCreateRule -->
+<!ELEMENT object-create-rule EMPTY>
+<!ATTLIST object-create-rule
+    pattern   CDATA #IMPLIED
+    classname CDATA #REQUIRED
+    attrname  CDATA #IMPLIED>
+
+<!-- SetPropertiesRule -->
+<!ELEMENT set-properties-rule (alias)*>
+<!ATTLIST set-properties-rule
+    pattern   CDATA #IMPLIED>
+
+<!-- SetNestedPropertiesRule -->
+<!ELEMENT set-nested-properties-rule (alias)*>
+<!ATTLIST set-nested-properties-rule
+    pattern                       CDATA #IMPLIED
+    allow-unknown-child-elements  CDATA #IMPLIED>
+
+<!-- An alias is a custom attribute->property name mapping -->
+<!ELEMENT alias EMPTY>
+<!ATTLIST alias
+ attr-name CDATA #REQUIRED
+ prop-name CDATA #IMPLIED>
+
+<!-- SetPropertyRule -->
+<!ELEMENT set-property-rule EMPTY>
+<!ATTLIST set-property-rule
+    pattern   CDATA #IMPLIED
+    name      CDATA #IMPLIED
+    value     CDATA #IMPLIED>
+
+<!-- SetTopRule -->
+<!ELEMENT set-top-rule EMPTY>
+<!ATTLIST set-top-rule
+    pattern    CDATA #IMPLIED
+    methodname CDATA #REQUIRED
+    paramtype  CDATA #IMPLIED>
+
+<!-- SetNextRule -->
+<!ELEMENT set-next-rule EMPTY>
+<!ATTLIST set-next-rule
+    pattern    CDATA #IMPLIED
+    methodname CDATA #REQUIRED
+    paramtype  CDATA #IMPLIED>
+
+<!-- SetRootRule -->
+<!ELEMENT set-root-rule EMPTY>
+<!ATTLIST set-root-rule
+    pattern    CDATA #IMPLIED
+    methodname CDATA #REQUIRED
+    paramtype  CDATA #IMPLIED>
+

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/digester-rules.dtd
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/package.html
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/package.html?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/package.html (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/package.html Tue Oct  4 13:51:32 2005
@@ -0,0 +1,2 @@
+<p>This package contains a JCR Command Line Interface backed by Commons chain 
+	commands.</p>
\ No newline at end of file

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/cli/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/AbstractCollect.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/AbstractCollect.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/AbstractCollect.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/AbstractCollect.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,153 @@
+/*
+ * Copyright 2002-2004 The Apache Software Foundation.
+ *
+ * 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.collect;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import javax.jcr.Node;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+import org.apache.jackrabbit.util.ChildrenCollectorFilter;
+
+/**
+ * Collect the children items from the given node and store them under the given
+ * key.
+ */
+public abstract class AbstractCollect implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(AbstractCollect.class);
+
+	// ---------------------------- < keys >
+
+	/** path key. Default value is "." */
+	private String srcPathKey = "srcPath";
+
+	/** context attribute key for the depth attribute. */
+	private String depthKey = "depth";
+
+	/** context attribute key for the name pattern attribute. Default value is "*" */
+	private String namePatternKey = "namePattern";
+
+	/** context attribute key for the destination attribute */
+	private String destKey = "collected";
+
+	/**
+	 * @inheritDoc
+	 */
+	public final boolean execute(Context ctx) throws Exception
+	{
+		if (this.destKey == null || this.destKey.length() == 0)
+		{
+			throw new IllegalStateException("target variable is not set");
+		}
+		String relPath = (String) ctx.get(this.srcPathKey);
+		if (relPath == null)
+		{
+			relPath = ".";
+		}
+		String namePattern = (String) ctx.get(this.namePatternKey);
+		if (namePattern == null || namePattern.length() == 0)
+		{
+			namePattern = "*";
+		}
+
+		int depth = Integer.parseInt((String) ctx.get(this.depthKey));
+
+		Node node = CommandHelper.getNode(ctx, relPath);
+		if (log.isDebugEnabled())
+		{
+			log.debug("collecting nodes from " + node.getPath() + " depth="
+					+ depth + " pattern=" + namePattern
+					+ " into target variable " + this.destKey);
+		}
+
+		Collection items = new ArrayList();
+		ChildrenCollectorFilter collector = new ChildrenCollectorFilter(
+				namePattern, items, isCollectNodes(), isCollectProperties(),
+				depth);
+		collector.visit(node);
+		ctx.put(this.destKey, items.iterator());
+
+		return false;
+	}
+
+	/**
+	 * @return Returns the depthKey.
+	 */
+	public String getDepthKey()
+	{
+		return depthKey;
+	}
+
+	/**
+	 * @param depthKey
+	 *            Set the context attribute key for the depth attribute
+	 */
+	public void setDepthKey(String depthKey)
+	{
+		this.depthKey = depthKey;
+	}
+
+	/**
+	 * @return Returns the namePatternKey.
+	 */
+	public String getNamePatternKey()
+	{
+		return namePatternKey;
+	}
+
+	/**
+	 * @param namePatternKey
+	 *            context attribute key for the name pattern attribute
+	 */
+	public void setNamePatternKey(String namePatternKey)
+	{
+		this.namePatternKey = namePatternKey;
+	}
+
+	/** Collect nodes flag */
+	protected abstract boolean isCollectNodes();
+
+	/** Collect properties flag */
+	protected abstract boolean isCollectProperties();
+
+	public String getDestKey()
+	{
+		return destKey;
+	}
+
+	public void setDestKey(String destKey)
+	{
+		this.destKey = destKey;
+	}
+
+	public String getSrcPathKey()
+	{
+		return srcPathKey;
+	}
+
+	public void setSrcPathKey(String srcPathKey)
+	{
+		this.srcPathKey = srcPathKey;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/AbstractCollect.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectItems.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectItems.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectItems.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectItems.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,40 @@
+/*
+ * 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.collect;
+
+/**
+ * Collect children, either nodes or properties
+ */
+public class CollectItems extends AbstractCollect
+{
+
+    /**
+     * @inheritDoc
+     */
+    protected boolean isCollectNodes()
+    {
+        return true;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    protected boolean isCollectProperties()
+    {
+        return true;
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectItems.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectNodes.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectNodes.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectNodes.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectNodes.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,41 @@
+/*
+ * 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.collect;
+
+/**
+ * Collect nodes only
+ */
+public class CollectNodes extends AbstractCollect
+{
+
+    /**
+     * @inheritDoc
+     */
+    protected boolean isCollectNodes()
+    {
+        return true;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    protected boolean isCollectProperties()
+    {
+        return false;
+    }
+    
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectNodes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectProperties.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectProperties.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectProperties.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectProperties.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,41 @@
+/*
+ * 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.collect;
+
+/**
+ * Collect properties only
+ */
+public class CollectProperties extends AbstractCollect
+{
+
+    /**
+     * @inheritDoc
+     */
+    protected boolean isCollectNodes()
+    {
+        return false;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    protected boolean isCollectProperties()
+    {
+        return true;
+    }
+    
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/collect/CollectProperties.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AbstractSetProperty.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AbstractSetProperty.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AbstractSetProperty.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AbstractSetProperty.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,86 @@
+/*
+ * 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.core;
+
+import org.apache.commons.chain.Command;
+
+/**
+ * SetProperty superclass.
+ */
+public abstract class AbstractSetProperty implements Command
+{
+	// ---------------------------- < keys >
+
+	/** destination node path key */
+	protected String parentPathKey = "parentPath";
+
+	/** Property name key */
+	protected String nameKey = "name";
+
+	/** Propety type key */
+	protected String typeKey = "type";
+
+	/** Property value key */
+	protected String valueKey = "value";
+
+	/**
+	 * @return Returns the valueKey.
+	 */
+	public String getValueKey()
+	{
+		return valueKey;
+	}
+
+	/**
+	 * @param valueKey
+	 *            Set the context attribute key for the value attribute.
+	 */
+	public void setValueKey(String valueKey)
+	{
+		this.valueKey = valueKey;
+	}
+
+	public String getParentPathKey()
+	{
+		return parentPathKey;
+	}
+
+	public void setParentPathKey(String parentPathKey)
+	{
+		this.parentPathKey = parentPathKey;
+	}
+
+	public String getNameKey()
+	{
+		return nameKey;
+	}
+
+	public void setNameKey(String nameKey)
+	{
+		this.nameKey = nameKey;
+	}
+
+	public String getTypeKey()
+	{
+		return typeKey;
+	}
+
+	public void setTypeKey(String typeKey)
+	{
+		this.typeKey = typeKey;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AbstractSetProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AddNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AddNode.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AddNode.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AddNode.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,100 @@
+/*
+ * 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.core;
+
+import javax.jcr.Node;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Add a node to the current working node.
+ */
+public class AddNode implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(AddNode.class);
+
+	// ---------------------------- < keys >
+
+	/** Node type key */
+	private String typeKey = "type";
+
+	/** Node name key */
+	private String relPathKey = "relPath";
+
+	/**
+	 * @inheritDoc
+	 */
+	public boolean execute(Context ctx) throws Exception
+	{
+		Node node = CommandHelper.getCurrentNode(ctx);
+		String nodeType = (String) ctx.get(this.typeKey);
+		String name = (String) ctx.get(this.relPathKey);
+
+		if (log.isDebugEnabled())
+		{
+			log.debug("adding node at " + node.getPath() + "/" + name);
+		}
+
+		if (nodeType == null)
+		{
+			node.addNode(name);
+		} else
+		{
+			node.addNode(name, nodeType);
+		}
+		return false;
+	}
+
+	/**
+	 * @return Returns the nodeTypeKey.
+	 */
+	public String getTypeKey()
+	{
+		return typeKey;
+	}
+
+	/**
+	 * @param nodeTypeKey
+	 *            Set the context attribute key for the node type attribute.
+	 */
+	public void setTypeKey(String nodeTypeKey)
+	{
+		this.typeKey = nodeTypeKey;
+	}
+
+	/**
+	 * @return Returns the relative path.
+	 */
+	public String getRelPathKey()
+	{
+		return relPathKey;
+	}
+
+	/**
+	 * @param relPathKey
+	 *            The relative path key to set.
+	 */
+	public void setRelPathKey(String relPathKey)
+	{
+		this.relPathKey = relPathKey;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/AddNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ClearWorkspace.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ClearWorkspace.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ClearWorkspace.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ClearWorkspace.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,75 @@
+/*
+ * 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.core;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.Session;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Remove all the content from the current working Workspace
+ */
+public class ClearWorkspace implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(ClearWorkspace.class);
+
+	/**
+	 * @inheritDoc
+	 */
+	public boolean execute(Context ctx) throws Exception
+	{
+		Session s = CommandHelper.getSession(ctx);
+
+		if (log.isDebugEnabled())
+		{
+			log.debug("removing all content from workspace "
+					+ s.getWorkspace().getName());
+		}
+
+		// Set current node to root
+		CommandHelper.setCurrentNode(ctx, s.getRootNode());
+		NodeIterator iter = s.getRootNode().getNodes();
+		while (iter.hasNext())
+		{
+			Node n = (Node) iter.next();
+			if (!n.getName().equals(JcrConstants.JCR_SYSTEM))
+			{
+				n.remove();
+			}
+		}
+		PropertyIterator pIter = s.getRootNode().getProperties();
+		while (pIter.hasNext())
+		{
+			Property p = pIter.nextProperty();
+			if (!p.getName().equals(JcrConstants.JCR_PRIMARYTYPE))
+			{
+				p.remove();
+			}
+		}
+		return false;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/ClearWorkspace.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,112 @@
+/*
+ * 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.core;
+
+import javax.jcr.Workspace;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Clones the given node to another workspace.
+ */
+public class Clone implements Command
+{
+    /** logger */
+    private static Log log = LogFactory.getLog(Clone.class);
+
+    // ---------------------------- < keys >
+    /** Source workspace */
+    private String srcWorkspaceKey = "scrWorkspace";
+
+    /** target workspace */
+    private String srcAbsPathKey = "srcAbsPath";
+
+    /** source node */
+    private String destAbsPathKey = "destAbsPath";
+
+    /** target node */
+    private String removeExistingKey = "removeExisting";
+
+    /**
+     * @inheritDoc
+     */
+    public boolean execute(Context ctx) throws Exception
+    {
+        String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
+        String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
+        String destAbsPath = (String) ctx.get(this.destAbsPathKey);
+        Boolean removeExisting = Boolean.valueOf((String) ctx
+            .get(this.removeExistingKey));
+
+        Workspace w = CommandHelper.getSession(ctx).getWorkspace();
+
+        if (log.isDebugEnabled())
+        {
+            log.debug("cloning node. from [" + srcWorkspace + ":" + srcAbsPath
+                    + "] to [" + w.getName() + ":" + destAbsPath + "]");
+        }
+
+        w.clone(srcWorkspace, srcAbsPath, destAbsPath, removeExisting
+            .booleanValue());
+
+        return false;
+    }
+
+    public String getDestAbsPathKey()
+    {
+        return destAbsPathKey;
+    }
+
+    public void setDestAbsPathKey(String destAbsPathKey)
+    {
+        this.destAbsPathKey = destAbsPathKey;
+    }
+
+    public String getRemoveExistingKey()
+    {
+        return removeExistingKey;
+    }
+
+    public void setRemoveExistingKey(String removeExistingKey)
+    {
+        this.removeExistingKey = removeExistingKey;
+    }
+
+    public String getSrcAbsPathKey()
+    {
+        return srcAbsPathKey;
+    }
+
+    public void setSrcAbsPathKey(String srcAbsPathKey)
+    {
+        this.srcAbsPathKey = srcAbsPathKey;
+    }
+
+    public String getSrcWorkspaceKey()
+    {
+        return srcWorkspaceKey;
+    }
+
+    public void setSrcWorkspaceKey(String srcWorkspaceKey)
+    {
+        this.srcWorkspaceKey = srcWorkspaceKey;
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Clone.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,104 @@
+/*
+ * 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.core;
+
+import javax.jcr.Workspace;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Copy a Node. If the source workspace is null it will create a copy of the
+ * given node from the current working workspace.
+ */
+public class Copy implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(Copy.class);
+
+	// ---------------------------- < keys >
+	/**
+	 * Source workspace.
+	 */
+	private String srcWorkspaceKey = "srcWorkspace";
+
+	/** source path */
+	private String srcAbsPathKey = "srcAbsPath";
+
+	/** destination path */
+	private String destAbsPathKey = "destAbsPath";
+
+	/**
+	 * @inheritDoc
+	 */
+	public boolean execute(Context ctx) throws Exception
+	{
+		String srcWorkspace = (String) ctx.get(this.srcWorkspaceKey);
+		String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
+		String destAbsPath = (String) ctx.get(this.destAbsPathKey);
+
+		Workspace w = CommandHelper.getSession(ctx).getWorkspace();
+		
+		if (srcWorkspace == null)
+		{
+			srcWorkspace = w.getName();
+		}
+
+		if (log.isDebugEnabled())
+		{
+			log.debug("copying node from [" + srcWorkspace + ":" + srcAbsPath
+					+ "] to [" + w.getName() + ":" + destAbsPath + "]");
+		}
+
+		w.copy(srcWorkspace, srcAbsPath, destAbsPath);
+
+		return false;
+	}
+
+	public String getDestAbsPathKey()
+	{
+		return destAbsPathKey;
+	}
+
+	public void setDestAbsPathKey(String destAbsPathKey)
+	{
+		this.destAbsPathKey = destAbsPathKey;
+	}
+
+	public String getSrcAbsPathKey()
+	{
+		return srcAbsPathKey;
+	}
+
+	public void setSrcAbsPathKey(String srcAbsPathKey)
+	{
+		this.srcAbsPathKey = srcAbsPathKey;
+	}
+
+	public String getSrcWorkspaceKey()
+	{
+		return srcWorkspaceKey;
+	}
+
+	public void setSrcWorkspaceKey(String srcWorkspaceKey)
+	{
+		this.srcWorkspaceKey = srcWorkspaceKey;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Copy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,68 @@
+/*
+ * 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.core;
+
+import javax.jcr.Node;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Set the current working Node.
+ */
+public class CurrentNode implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(CurrentNode.class);
+
+	// ---------------------------- < keys >
+
+	/** context attribute key for the path attribute */
+	private String pathKey = "path";
+
+	/**
+	 * @inheritDoc
+	 */
+	public boolean execute(Context ctx) throws Exception
+	{
+		String dest = (String) ctx.get(this.pathKey);
+		Node n = CommandHelper.getNode(ctx, dest);
+		if (log.isDebugEnabled())
+		{
+			log.debug("set current working node to " + n.getPath());
+		}
+		CommandHelper.setCurrentNode(ctx, n);
+		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;
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/CurrentNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,153 @@
+/*
+ * 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.core;
+
+import javax.jcr.Credentials;
+import javax.jcr.Repository;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+import org.apache.jackrabbit.command.CommandException;
+
+/**
+ * Login command.
+ */
+public class Login implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(Login.class);
+
+	// ---------------------------- < keys >
+	/** user key */
+	private String userKey = "user";
+
+	/** password key */
+	private String passwordKey = "password";
+
+	/** workspace key */
+	private String workspaceKey = "workspace";
+
+	/**
+	 * @inheritDoc
+	 */
+	public boolean execute(Context ctx) throws Exception
+	{
+		if (CommandHelper.getSession(ctx) != null)
+		{
+			throw new CommandException("exception.already.logged.in");
+		}
+
+		String anon = "anonymous";
+
+		String user = (String) ctx.get(this.userKey);
+		String password = (String) ctx.get(this.passwordKey);
+		String workspace = (String) ctx.get(this.workspaceKey);
+
+		if (user == null)
+		{
+			user = anon;
+		}
+
+		if (password == null)
+		{
+			password = anon;
+		}
+
+		if (log.isDebugEnabled())
+		{
+			log.debug("logging in as " + user);
+		}
+
+		Session session = null;
+		Repository repo = CommandHelper.getRepository(ctx);
+
+		if (repo == null)
+		{
+			throw new CommandException("exception.repository.not.in.context");
+		}
+
+		Credentials credentials = new SimpleCredentials(user, password
+				.toCharArray());
+
+		if (workspace == null)
+		{
+			session = repo.login(credentials);
+		} else
+		{
+			session = repo.login(credentials, workspace);
+		}
+		CommandHelper.setSession(ctx, session);
+		CommandHelper.setCurrentNode(ctx, session.getRootNode());
+		return false;
+	}
+
+	/**
+	 * @return Returns the passwordKey.
+	 */
+	public String getPasswordKey()
+	{
+		return passwordKey;
+	}
+
+	/**
+	 * @param passwordKey
+	 *            Set the context attribute key for the password attribute.
+	 */
+	public void setPasswordKey(String passwordKey)
+	{
+		this.passwordKey = passwordKey;
+	}
+
+	/**
+	 * @return Returns the userKey.
+	 */
+	public String getUserKey()
+	{
+		return userKey;
+	}
+
+	/**
+	 * @param userKey
+	 *            Set the context attribute key for the user attribute.
+	 */
+	public void setUserKey(String userKey)
+	{
+		this.userKey = userKey;
+	}
+
+	/**
+	 * @return Returns the workspaceKey.
+	 */
+	public String getWorkspaceKey()
+	{
+		return workspaceKey;
+	}
+
+	/**
+	 * @param workspaceKey
+	 *            Set the context attribute key for the workspace attribute.
+	 */
+	public void setWorkspaceKey(String workspaceKey)
+	{
+		this.workspaceKey = workspaceKey;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Login.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,52 @@
+/*
+ * 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.core;
+
+import javax.jcr.Session;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Logout command
+ */
+public class Logout implements Command
+{
+	/** logger */
+	private static Log log = LogFactory.getLog(Logout.class);
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.apache.commons.chain.Command#execute(org.apache.commons.chain.Context)
+	 */
+	public boolean execute(Context ctx) throws Exception
+	{
+		Session s = CommandHelper.getSession(ctx);
+		if (log.isDebugEnabled())
+		{
+			log.debug("logging out user " + s.getUserID());
+		}
+		s.logout();
+		CommandHelper.setCurrentNode(ctx, null);
+		CommandHelper.setSession(ctx, null);
+		return false;
+	}
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Logout.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,108 @@
+/*
+ * 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.core;
+
+import java.util.ResourceBundle;
+
+import javax.jcr.Workspace;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Move a Node.
+ */
+public class Move implements Command
+{
+    /** resource bundle */
+    private static ResourceBundle bundle = CommandHelper.getBundle();
+
+    /** logger */
+    private static Log log = LogFactory.getLog(Move.class);
+
+    // ---------------------------- < keys >
+    /** source path */
+    private String srcAbsPathKey = "srcAbsPath";
+
+    /** destination path */
+    private String destAbsPathKey = "destAbsPath";
+
+    /**
+     * @inheritDoc
+     */
+    public boolean execute(Context ctx) throws Exception
+    {
+        String srcAbsPath = (String) ctx.get(this.srcAbsPathKey);
+        String destAbsPath = (String) ctx.get(this.destAbsPathKey);
+
+        if (!srcAbsPath.startsWith("/") || !destAbsPath.startsWith("/"))
+        {
+            throw new IllegalArgumentException(
+                bundle.getString("exception.illegalargument")
+                + ". " + 
+                bundle.getString("exception.only.absolute.path") + ".");
+        }
+
+        Workspace w = CommandHelper.getSession(ctx).getWorkspace();
+
+        if (log.isDebugEnabled())
+        {
+            log.debug("moving node from " + srcAbsPath + " to " + destAbsPath);
+        }
+
+        w.move(srcAbsPath, destAbsPath);
+
+        return false;
+    }
+
+    /**
+     * @return Returns the destAbsPathKey.
+     */
+    public String getDestAbsPathKey()
+    {
+        return destAbsPathKey;
+    }
+
+    /**
+     * @param destAbsPathKey
+     *            The destAbsPathKey to set.
+     */
+    public void setDestAbsPathKey(String destAbsPathKey)
+    {
+        this.destAbsPathKey = destAbsPathKey;
+    }
+
+    /**
+     * @return Returns the srcAbsPathKey.
+     */
+    public String getSrcAbsPathKey()
+    {
+        return srcAbsPathKey;
+    }
+
+    /**
+     * @param srcAbsPathKey
+     *            The srcAbsPathKey to set.
+     */
+    public void setSrcAbsPathKey(String srcAbsPathKey)
+    {
+        this.srcAbsPathKey = srcAbsPathKey;
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/Move.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java?rev=294914&view=auto
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java (added)
+++ incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java Tue Oct  4 13:51:32 2005
@@ -0,0 +1,101 @@
+/*
+ * 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.core;
+
+import javax.jcr.Node;
+
+import org.apache.commons.chain.Command;
+import org.apache.commons.chain.Context;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.command.CommandHelper;
+
+/**
+ * Sets the order of the given node.
+ */
+public class OrderBefore implements Command
+{
+    /** logger */
+    private static Log log = LogFactory.getLog(OrderBefore.class);
+
+    // ---------------------------- < keys >
+    /** node path */
+    private String parentPathKey = "parentPath";
+
+    /** source path */
+    private String srcChildKey = "srcChild";
+
+    /** destination path */
+    private String destChildKey = "destChild";
+
+    public boolean execute(Context ctx) throws Exception
+    {
+        String parentPath = (String) ctx.get(this.parentPathKey);
+        Node n = CommandHelper.getNode(ctx, parentPath);
+
+        String srcChildPath = (String) ctx.get(this.srcChildKey);
+        String destChildPath = (String) ctx.get(this.destChildKey);
+
+        if (log.isDebugEnabled())
+        {
+            log.debug("ordering before. from " + n.getPath() + "/"
+                    + srcChildPath + " to " + n.getPath() + "/"
+                    + destChildPath);
+        }
+
+        n.orderBefore(srcChildPath, destChildPath);
+
+        return false;
+    }
+
+    public String getDestChildKey()
+    {
+        return destChildKey;
+    }
+
+    public void setDestChildKey(String destChildRelPathKey)
+    {
+        this.destChildKey = destChildRelPathKey;
+    }
+
+    public String getSrcChildKey()
+    {
+        return srcChildKey;
+    }
+
+    public void setSrcChildKey(String srcChildRelPathKey)
+    {
+        this.srcChildKey = srcChildRelPathKey;
+    }
+
+    /**
+     * @return Returns the parentPathKey.
+     */
+    public String getParentPathKey()
+    {
+        return parentPathKey;
+    }
+
+    /**
+     * @param parentPathKey
+     *            The parentPathKey to set.
+     */
+    public void setParentPathKey(String parentPathKey)
+    {
+        this.parentPathKey = parentPathKey;
+    }
+}

Propchange: incubator/jackrabbit/trunk/contrib/jcr-commands/src/java/org/apache/jackrabbit/command/core/OrderBefore.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message