incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1520581 - in /sling/branches/tooling-ide-vlt/tooling/ide: impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java impl-vlt/src/org/apache/sling/ide/impl/vlt/VltRepository.java vlt-wrapper/META-INF/MANIFEST.MF
Date Fri, 06 Sep 2013 14:36:29 GMT
Author: rombert
Date: Fri Sep  6 14:36:29 2013
New Revision: 1520581

URL: http://svn.apache.org/r1520581
Log:
SLING-2989 - [Tooling] integrate with vlt once available

Implement node deletion.

Added:
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java
  (with props)
Modified:
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltRepository.java
    sling/branches/tooling-ide-vlt/tooling/ide/vlt-wrapper/META-INF/MANIFEST.MF

Added: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java?rev=1520581&view=auto
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java
(added)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java
Fri Sep  6 14:36:29 2013
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+package org.apache.sling.ide.impl.vlt;
+
+import java.io.IOException;
+
+import javax.jcr.Credentials;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.vault.util.PathUtil;
+import org.apache.sling.ide.transport.FileInfo;
+
+public class DeleteNodeCommand extends JcrCommand<Void> {
+
+    public DeleteNodeCommand(Repository repository, Credentials credentials, FileInfo fileInfo)
{
+        super(repository, credentials, PathUtil.makePath(fileInfo.getRelativeLocation(),
fileInfo.getName()));
+    }
+
+    @Override
+    protected Void execute0(Session session) throws RepositoryException, IOException {
+
+        if (session.nodeExists(getPath())) {
+            session.getNode(getPath()).remove();
+        }
+
+        return null;
+    }
+
+}

Propchange: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/DeleteNodeCommand.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev URL

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltRepository.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltRepository.java?rev=1520581&r1=1520580&r2=1520581&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltRepository.java
(original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VltRepository.java
Fri Sep  6 14:36:29 2013
@@ -59,8 +59,7 @@ public class VltRepository implements Re
 
     @Override
     public Command<Void> newDeleteNodeCommand(FileInfo fileInfo) {
-        // TODO implement
-        return new NoOpCommand<Void>(jcrRepo, credentials);
+        return TracingCommand.wrap(new DeleteNodeCommand(jcrRepo, credentials, fileInfo),
eventAdmin);
     }
 
     @Override

Modified: sling/branches/tooling-ide-vlt/tooling/ide/vlt-wrapper/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/vlt-wrapper/META-INF/MANIFEST.MF?rev=1520581&r1=1520580&r2=1520581&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/vlt-wrapper/META-INF/MANIFEST.MF (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/vlt-wrapper/META-INF/MANIFEST.MF Fri Sep  6
14:36:29 2013
@@ -45,6 +45,7 @@ Import-Package: org.apache.commons.httpc
  org.apache.commons.httpclient.util;version="3.1.0",
  org.apache.commons.collections.map,
  org.apache.commons.collections.list,
+ org.apache.commons.collections.iterators,
  org.apache.commons.logging,
  org.apache.commons.codec,
  org.apache.commons.io,



Mime
View raw message