jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r896969 - in /jackrabbit/trunk/jackrabbit-standalone: ./ src/main/java/org/apache/jackrabbit/command/ src/main/java/org/apache/jackrabbit/command/cli/ src/main/java/org/apache/jackrabbit/command/ext/ src/main/java/org/apache/jackrabbit/comm...
Date Thu, 07 Jan 2010 19:08:09 GMT
Author: jukka
Date: Thu Jan  7 19:08:08 2010
New Revision: 896969

URL: http://svn.apache.org/viewvc?rev=896969&view=rev
Log:
JCR-2457: Command line access to remote repositories

Resurrect the jcr-command codebase by importing it to jackrabbit-standalone. Initial integration
steps.

Added:
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/
      - copied from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/services/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command-line-rules.xml
      - copied unchanged from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line-rules.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command-line.xml
      - copied unchanged from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command-line.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command.xml
      - copied, changed from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/digester-rules.dtd
      - copied unchanged from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/digester-rules.dtd
    jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/resources.properties
      - copied unchanged from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/resources.properties
Removed:
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/command-line-rules.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/command-line.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/command.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/digester-rules.dtd
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/ext/RegisterNodeType.java
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/resources.properties
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/web/
Modified:
    jackrabbit/trunk/jackrabbit-standalone/pom.xml
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/JcrClient.java
    jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java

Modified: jackrabbit/trunk/jackrabbit-standalone/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/pom.xml?rev=896969&r1=896968&r2=896969&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-standalone/pom.xml Thu Jan  7 19:08:08 2010
@@ -52,7 +52,7 @@
               org.apache.jackrabbit.standalone
             </Export-Package>
             <Embed-Dependency>
-              *;inline=*.txt|*.html|*.jsp|*.xml|*.jar|*.properties|remoting/**|bootstrap/**|javax/**|repackage/**|images/**|com/**|Resources/**|css/**|schema*/**|EDU/**|error/**|org/**|META-INF/*.tld|META-INF/maven/**|META-INF/services/**|WEB-INF/config.xml|WEB-INF/*.properties|WEB-INF/templates/**
+              *;inline=*.txt|*.html|*.jsp|*.xml|*.jar|*.properties|remoting/**|bootstrap/**|javax/**|repackage/**|images/**|com/**|jline/**|Resources/**|css/**|schema*/**|EDU/**|error/**|org/**|META-INF/*.tld|META-INF/maven/**|META-INF/services/**|WEB-INF/config.xml|WEB-INF/*.properties|WEB-INF/templates/**
             </Embed-Dependency>
             <Embed-Transitive>true</Embed-Transitive>
             <Main-Class>org.apache.jackrabbit.standalone.Main</Main-Class>
@@ -81,6 +81,11 @@
       <type>jar</type>
     </dependency>
     <dependency>
+      <groupId>org.apache.jackrabbit</groupId>
+      <artifactId>jackrabbit-jcr2dav</artifactId>
+      <version>2.1-SNAPSHOT</version>
+    </dependency>
+    <dependency>
       <groupId>org.mortbay.jetty</groupId>
       <artifactId>jetty</artifactId>
     </dependency>
@@ -101,6 +106,33 @@
       <artifactId>commons-cli</artifactId>
       <version>1.1</version>
     </dependency>
+    <dependency>
+      <groupId>commons-chain</groupId>
+      <artifactId>commons-chain</artifactId>
+      <version>1.0</version>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>jline</groupId>
+      <artifactId>jline</artifactId>
+      <version>0.9.94</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-jexl</groupId>
+      <artifactId>commons-jexl</artifactId>
+      <version>1.1</version>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
   </dependencies>
 
 </project>

Modified: jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/JcrClient.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/JcrClient.java?rev=896969&r1=896919&r2=896969&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/JcrClient.java
(original)
+++ jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/command/cli/JcrClient.java
Thu Jan  7 19:08:08 2010
@@ -85,7 +85,7 @@
      * @param ctx
      *        the <code>Context</code>
      */
-    JcrClient(Context ctx) {
+    public JcrClient(Context ctx) {
         super();
         this.ctx = ctx;
     }
@@ -177,6 +177,10 @@
      *         if an Exception occurs
      */
     private void runInteractive(CommandLine cl) throws Exception {
+        runInteractive();
+    }
+
+    public void runInteractive() throws Exception {
         // built jline console reader with history + tab completion
         ConsoleReader reader = new ConsoleReader();
         reader.setHistory(new History());

Modified: jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java?rev=896969&r1=896968&r2=896969&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
(original)
+++ jackrabbit/trunk/jackrabbit-standalone/src/main/java/org/apache/jackrabbit/standalone/Main.java
Thu Jan  7 19:08:08 2010
@@ -21,12 +21,19 @@
 import java.io.InputStream;
 import java.net.URL;
 
+import javax.jcr.Repository;
+
+import org.apache.commons.chain.Context;
+import org.apache.commons.chain.impl.ContextBase;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.GnuParser;
 import org.apache.commons.cli.HelpFormatter;
 import org.apache.commons.cli.Options;
 import org.apache.commons.cli.ParseException;
 import org.apache.commons.io.IOUtils;
+import org.apache.jackrabbit.command.CommandHelper;
+import org.apache.jackrabbit.command.cli.JcrClient;
+import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.core.RepositoryCopier;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
 import org.apache.jackrabbit.servlet.jackrabbit.JackrabbitRepositoryServlet;
@@ -73,6 +80,8 @@
         options.addOption("l", "license", false, "print license information");
         options.addOption(
                 "b", "backup", false, "create a backup of the repository");
+        options.addOption(
+                "i", "cli", true, "command line access to a remote repository");
 
         options.addOption("q", "quiet", false, "disable console output");
         options.addOption("d", "debug", false, "enable debug logging");
@@ -111,6 +120,12 @@
             copyToOutput("/META-INF/NOTICE.txt");
         } else if (command.hasOption("license")) {
             copyToOutput("/META-INF/LICENSE.txt");
+        } else if (command.hasOption("cli")) {
+            Context context = new ContextBase();
+            String uri = command.getOptionValue("cli");
+            Repository repository = JcrUtils.getRepository(uri);
+            CommandHelper.setRepository(context, repository, uri);
+            new JcrClient(context).runInteractive();
         } else {
             message("Welcome to Apache Jackrabbit!");
             message("-------------------------------");

Added: jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory?rev=896969&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
(added)
+++ jackrabbit/trunk/jackrabbit-standalone/src/main/resources/META-INF/services/javax.jcr.RepositoryFactory
Thu Jan  7 19:08:08 2010
@@ -0,0 +1,18 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You 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.
+
+org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory
+org.apache.jackrabbit.commons.GenericRepositoryFactory
+

Copied: jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command.xml
(from r896919, jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command.xml?p2=jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command.xml&p1=jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml&r1=896919&r2=896969&rev=896969&view=diff
==============================================================================
--- jackrabbit/sandbox/inactive/jcr-commands/src/java/org/apache/jackrabbit/command/cli/command.xml
(original)
+++ jackrabbit/trunk/jackrabbit-standalone/src/main/resources/org/apache/jackrabbit/command/cli/command.xml
Thu Jan  7 19:08:08 2010
@@ -178,14 +178,6 @@
 		<command name="registerNamespace"
 			className="org.apache.jackrabbit.command.namespace.RegisterNamespace"/>
 
-		<chain name="registerNodeType">
-			<command name="readFile"
-				className="org.apache.jackrabbit.command.fs.FileToInputStream"
-				destKey="cndStream"/>
-			<command name="register"
-				className="org.apache.jackrabbit.command.ext.RegisterNodeType"/>
-		</chain>
-		
 		<command name="removeItem"
 			className="org.apache.jackrabbit.command.core.RemoveItem"/>
 						
@@ -256,15 +248,6 @@
 		<command name="setNamespacePrefix"
 			className="org.apache.jackrabbit.command.namespace.SetNamespacePrefix"/>
 
-		<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"/>
 



Mime
View raw message