incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1520302 - in /sling/branches/tooling-ide-vlt/tooling/ide: api/src/org/apache/sling/ide/serialization/ api/src/org/apache/sling/ide/transport/ eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/ impl-resource-test/src/test/java/org/apa...
Date Thu, 05 Sep 2013 13:39:34 GMT
Author: rombert
Date: Thu Sep  5 13:39:33 2013
New Revision: 1520302

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

Have a (seemingly) functional checkout with .content.xml from a Sling
repo

TODO:

- very very slow
- no filtering , we use the default workspace filters
- still no write support

Added:
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml   (with props)
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml   (with props)
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/RepositoryUtils.java   (with props)
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocator.java
      - copied, changed from r1514762, sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocatorImpl.java
      - copied, changed from r1514762, sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/serialization/
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java   (with props)
Modified:
    sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java
    sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/Repository.java
    sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/ResourceProxy.java
    sling/branches/tooling-ide-vlt/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/ImportWizard.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/META-INF/MANIFEST.MF
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltRepository.xml
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/GetNodeContentCommand.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java
    sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/ListChildrenCommand.java
    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/target-definition/org.apache.sling.ide.target-definition.target
    sling/branches/tooling-ide-vlt/tooling/ide/vlt-wrapper/META-INF/MANIFEST.MF

Modified: sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java Thu Sep  5 13:39:33 2013
@@ -20,6 +20,9 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.util.Map;
 
+import org.apache.sling.ide.transport.RepositoryInfo;
+import org.apache.sling.ide.transport.ResourceProxy;
+
 public interface SerializationManager {
 
     boolean isSerializationFile(String filePath);
@@ -28,7 +31,7 @@ public interface SerializationManager {
 
     String getSerializationFilePath(String baseFilePath);
 
-    String buildSerializationData(Map<String, Object> content) throws IOException;
+    String buildSerializationData(ResourceProxy resource, RepositoryInfo repositoryInfo) throws IOException;
 
     Map<String, Object> readSerializationData(InputStream source) throws IOException;
 }

Modified: sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/Repository.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/Repository.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/Repository.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/Repository.java Thu Sep  5 13:39:33 2013
@@ -81,6 +81,8 @@ public interface Repository {
     // FIXME this is not thread-safe and with multiple sling servers will fail intermitently
 	public void setRepositoryInfo(RepositoryInfo repositoryInfo);
 
+    RepositoryInfo getRepositoryInfo();
+
 	Command<Void> newAddNodeCommand(FileInfo fileInfo);
 	
     Command<Void> newUpdateContentNodeCommand(FileInfo fileInfo, Map<String, Object> serializationData);
@@ -101,7 +103,7 @@ public interface Repository {
      * @param path
      * @return all properties for the resource located at <tt>path</tt>
      */
-    Command<Map<String, Object>> newGetNodeContentCommand(String path);
+    Command<ResourceProxy> newGetNodeContentCommand(String path);
 
 	Command<byte[]> newGetNodeCommand(String path);
 }

Modified: sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/ResourceProxy.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/ResourceProxy.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/ResourceProxy.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/transport/ResourceProxy.java Thu Sep  5 13:39:33 2013
@@ -26,6 +26,7 @@ public class ResourceProxy {
     private final String path;
     private final Map<String, Object> properties = new HashMap<String, Object>();
     private final List<ResourceProxy> children = new ArrayList<ResourceProxy>();
+    private final Map<Class<?>, Object> adapted = new HashMap<Class<?>, Object>(1);
 
     public ResourceProxy(String path) {
         this.path = path;
@@ -53,6 +54,19 @@ public class ResourceProxy {
         return properties;
     }
 
+    public <T> void addAdapted(Class<T> klazz, T adaptedInstance) {
+
+        adapted.put(klazz, adaptedInstance);
+    }
+
+    public <T> T adaptTo(Class<T> klazz) {
+
+        // OK to suppress warnings since type safety is insured by addAdapted
+        @SuppressWarnings("unchecked")
+        T res = (T) adapted.get(klazz);
+
+        return res;
+    }
 
     @Override
     public String toString() {

Modified: sling/branches/tooling-ide-vlt/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/ImportWizard.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/ImportWizard.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/ImportWizard.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/internal/ImportWizard.java Thu Sep  5 13:39:33 2013
@@ -20,7 +20,6 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
 
 import org.apache.sling.ide.eclipse.core.ISlingLaunchpadServer;
 import org.apache.sling.ide.eclipse.core.ServerUtil;
@@ -233,9 +232,10 @@ public class ImportWizard extends Wizard
 			//DO NOTHING
         } else {
 			createFolder(project, projectRelativePath.append(path));
-            Map<String, Object> content = executeCommand(repository.newGetNodeContentCommand(path));
+            ResourceProxy resourceToSerialize = executeCommand(repository.newGetNodeContentCommand(path));
             
-            String out = serializationManager.buildSerializationData(content);
+            String out = serializationManager.buildSerializationData(resourceToSerialize,
+                    repository.getRepositoryInfo());
             if (out != null) {
                 createFile(project, projectRelativePath.append(serializationManager.getSerializationFilePath(path)),
                     out.getBytes("UTF-8"));
@@ -289,6 +289,9 @@ public class ImportWizard extends Wizard
     private void createFile(IProject project, IPath path, byte[] node) throws CoreException {
 		
 		IFile destinationFile = project.getFile(path);
+
+        System.out.println("Writing content file at " + path);
+
 		if ( destinationFile.exists() ) {
             /* TODO progress monitor */
             destinationFile.setContents(new ByteArrayInputStream(node), IResource.KEEP_HISTORY, null);

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java Thu Sep  5 13:39:33 2013
@@ -12,6 +12,7 @@ import java.io.StringReader;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.sling.ide.transport.ResourceProxy;
 import org.custommonkey.xmlunit.XMLUnit;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -36,15 +37,23 @@ public class SimpleXmlSerializationManag
     @Test
     public void emptySerializedData() throws IOException, SAXException {
 
-        String serializationData = sm.buildSerializationData(new HashMap<String, Object>());
+        String serializationData = sm.buildSerializationData(newResourceWithProperties(new HashMap<String, Object>()), null);
 
         assertThat(serializationData, is(nullValue()));
     }
 
+    private ResourceProxy newResourceWithProperties(Map<String, Object> properties) {
+        ResourceProxy resource = new ResourceProxy("/");
+        for (Map.Entry<String, Object> entry : properties.entrySet()) {
+            resource.addProperty(entry.getKey(), entry.getValue());
+        }
+        return resource;
+    }
+
     @Test
     public void nullSerializedData() throws IOException, SAXException {
 
-        String serializationData = sm.buildSerializationData(null);
+        String serializationData = sm.buildSerializationData(null, null);
 
         assertThat(serializationData, is(nullValue()));
     }
@@ -56,7 +65,7 @@ public class SimpleXmlSerializationManag
         data.put("jcr:createdBy", "admin");
         data.put("jcr:lastModifiedBy", "author");
 
-        String serializationData = sm.buildSerializationData(data);
+        String serializationData = sm.buildSerializationData(newResourceWithProperties(data), null);
 
         String methodName = "stringSerializedData";
 
@@ -84,7 +93,7 @@ public class SimpleXmlSerializationManag
         Map<String, Object> data = new HashMap<String, Object>();
         data.put("jcr:description", "<p class=\"active\">Welcome</p>");
 
-        String serializationData = sm.buildSerializationData(data);
+        String serializationData = sm.buildSerializationData(newResourceWithProperties(data), null);
 
         String methodName = "serializedDataIsEscaped";
 

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java Thu Sep  5 13:39:33 2013
@@ -35,6 +35,8 @@ import javax.xml.transform.sax.Transform
 import javax.xml.transform.stream.StreamResult;
 
 import org.apache.sling.ide.serialization.SerializationManager;
+import org.apache.sling.ide.transport.RepositoryInfo;
+import org.apache.sling.ide.transport.ResourceProxy;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
@@ -96,7 +98,13 @@ public class SimpleXmlSerializationManag
     }
 
     @Override
-    public String buildSerializationData(Map<String, Object> content) throws IOException {
+    public String buildSerializationData(ResourceProxy resource, RepositoryInfo repositoryInfo) throws IOException {
+
+        if (resource == null) {
+            return null;
+        }
+
+        Map<String, Object> content = resource.getProperties();
 
         if (content == null || content.isEmpty()) {
             return null;

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java Thu Sep  5 13:39:33 2013
@@ -27,6 +27,10 @@ public abstract class AbstractRepository
 		this.repositoryInfo=repositoryInfo;
 	}
 
+    @Override
+    public RepositoryInfo getRepositoryInfo() {
+        return repositoryInfo;
+    }
 
 	@Override
 	public String toString() {

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java Thu Sep  5 13:39:33 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.sling.ide.impl.resource.transport;
 
-import java.util.HashMap;
-import java.util.Map;
 
 import org.apache.commons.httpclient.Credentials;
 import org.apache.commons.httpclient.HttpClient;
@@ -26,18 +24,19 @@ import org.apache.commons.httpclient.aut
 import org.apache.commons.httpclient.methods.GetMethod;
 import org.apache.sling.ide.transport.RepositoryException;
 import org.apache.sling.ide.transport.RepositoryInfo;
+import org.apache.sling.ide.transport.ResourceProxy;
 import org.apache.sling.ide.transport.Result;
 import org.json.JSONArray;
 import org.json.JSONObject;
 
-class GetNodeContentCommand extends AbstractCommand<Map<String, Object>> {
+class GetNodeContentCommand extends AbstractCommand<ResourceProxy> {
 
     GetNodeContentCommand(RepositoryInfo repositoryInfo, HttpClient httpClient, String relativePath) {
         super(repositoryInfo, httpClient, relativePath);
     }
 
     @Override
-    public Result<Map<String, Object>> execute() {
+    public Result<ResourceProxy> execute() {
         GetMethod get = new GetMethod(getPath());
     	try{
     		httpClient.getParams().setAuthenticationPreemptive(true);
@@ -51,20 +50,20 @@ class GetNodeContentCommand extends Abst
 
             JSONObject result = new JSONObject(get.getResponseBodyAsString());
 
-            Map<String, Object> properties = new HashMap<String, Object>();
+            ResourceProxy resource = new ResourceProxy(path);
             JSONArray names = result.names();
             for (int i = 0; i < names.length(); i++) {
                 String name = names.getString(i);
                 Object object = result.get(name);
                 if (object instanceof String) {
-                    properties.put(name, object);
+                    resource.addProperty(name, object);
                 } else {
                     System.out.println("Property '" + name + "' of type '" + object.getClass().getName()
                             + " is not handled");
                 }
             }
 
-            return AbstractResult.success(properties);
+            return AbstractResult.success(resource);
     	} catch (Exception e) {
     		return AbstractResult.failure(new RepositoryException(e));
     	}finally{

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java Thu Sep  5 13:39:33 2013
@@ -57,7 +57,7 @@ public class RepositoryImpl extends Abst
 	}
 	
 	@Override
-    public Command<Map<String, Object>> newGetNodeContentCommand(final String path) {
+    public Command<ResourceProxy> newGetNodeContentCommand(final String path) {
         return wrap(new GetNodeContentCommand(repositoryInfo, httpClient, path + ".json"));
 	}
 	

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/META-INF/MANIFEST.MF?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/META-INF/MANIFEST.MF (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/META-INF/MANIFEST.MF Thu Sep  5 13:39:33 2013
@@ -7,8 +7,13 @@ Bundle-RequiredExecutionEnvironment: Jav
 Require-Bundle: org.eclipse.equinox.ds;bundle-version="1.2.1",
  org.eclipse.osgi.services;bundle-version="3.2.100"
 Import-Package: javax.jcr,
+ org.apache.jackrabbit.vault.fs,
  org.apache.jackrabbit.vault.fs.api,
+ org.apache.jackrabbit.vault.fs.config,
+ org.apache.jackrabbit.vault.fs.impl,
+ org.apache.jackrabbit.vault.fs.impl.io,
  org.apache.jackrabbit.vault.util,
+ org.apache.sling.ide.serialization,
  org.apache.sling.ide.transport,
  org.osgi.service.event;version="1.3.0"
 Service-Component: OSGI-INF/*.xml

Added: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml?rev=1520302&view=auto
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml (added)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml Thu Sep  5 13:39:33 2013
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="false">
+   <implementation class="org.apache.sling.ide.impl.vlt.VaultFsLocatorImpl"/>
+   <service>
+      <provide interface="org.apache.sling.ide.impl.vlt.VaultFsLocator"/>
+   </service>
+</scr:component>

Propchange: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VaultFsLocatorImpl.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltRepository.xml
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltRepository.xml?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltRepository.xml (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltRepository.xml Thu Sep  5 13:39:33 2013
@@ -5,4 +5,5 @@
       <provide interface="org.apache.sling.ide.transport.Repository"/>
    </service>
    <reference bind="bindEventAdmin" cardinality="1..1" interface="org.osgi.service.event.EventAdmin" name="EventAdmin" policy="static" unbind="unbindEventAdmin"/>
+   <property name="service.ranking" type="Integer" value="100"/>
 </scr:component>

Added: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml?rev=1520302&view=auto
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml (added)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml Thu Sep  5 13:39:33 2013
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="false">
+   <implementation class="org.apache.sling.ide.impl.vlt.serialization.VltSerializationManager"/>
+   <service>
+      <provide interface="org.apache.sling.ide.serialization.SerializationManager"/>
+   </service>
+   <reference bind="bindVaultFsLocator" cardinality="1..1" interface="org.apache.sling.ide.impl.vlt.VaultFsLocator" name="VaultFsLocator" policy="static" unbind="unbindVaultFsLocator"/>
+   <property name="service.ranking" type="Integer" value="100"/>   
+</scr:component>

Propchange: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/OSGI-INF/VltSerializationManagerImpl.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/GetNodeContentCommand.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/GetNodeContentCommand.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/GetNodeContentCommand.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/GetNodeContentCommand.java Thu Sep  5 13:39:33 2013
@@ -16,42 +16,25 @@
  */
 package org.apache.sling.ide.impl.vlt;
 
-import java.util.HashMap;
-import java.util.Map;
-
 import javax.jcr.Credentials;
 import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
-public class GetNodeContentCommand extends JcrCommand<Map<String, Object>> {
+import org.apache.sling.ide.transport.ResourceProxy;
+
+public class GetNodeContentCommand extends JcrCommand<ResourceProxy> {
 
     public GetNodeContentCommand(Repository repository, Credentials credentials, String path) {
         super(repository, credentials, path);
     }
 
     @Override
-    protected Map<String, Object> execute0(Session session) throws RepositoryException {
+    protected ResourceProxy execute0(Session session) throws RepositoryException {
 
         Node node = session.getNode(getPath());
-        PropertyIterator properties = node.getProperties();
-
-        Map<String, Object> props = new HashMap<String, Object>();
 
-        while (properties.hasNext()) {
-
-            Property property = properties.nextProperty();
-            Object value = ConversionUtils.getPropertyValue(property);
-            if (value == null) {
-                continue;
-            }
-            props.put(property.getName(), value);
-        }
-
-        return props;
+        return nodeToResource(node);
     }
-
 }

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/JcrCommand.java Thu Sep  5 13:39:33 2013
@@ -20,11 +20,15 @@ import java.io.IOException;
 
 import javax.jcr.Credentials;
 import javax.jcr.LoginException;
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.sling.ide.transport.Command;
+import org.apache.sling.ide.transport.ResourceProxy;
 import org.apache.sling.ide.transport.Result;
 
 public abstract class JcrCommand<T> implements Command<T> {
@@ -61,4 +65,25 @@ public abstract class JcrCommand<T> impl
     public String getPath() {
         return path;
     }
+
+
+    protected ResourceProxy nodeToResource(Node node) throws RepositoryException {
+    
+        ResourceProxy resource = new ResourceProxy(node.getPath());
+        resource.addAdapted(Node.class, node);
+
+        PropertyIterator properties = node.getProperties();
+        while (properties.hasNext()) {
+            Property property = properties.nextProperty();
+            String propertyName = property.getName();
+            Object propertyValue = ConversionUtils.getPropertyValue(property);
+    
+            if (propertyValue != null) {
+                resource.addProperty(propertyName, propertyValue);
+            }
+        }
+    
+        return resource;
+    
+    }
 }

Modified: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/ListChildrenCommand.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/ListChildrenCommand.java?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/ListChildrenCommand.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/ListChildrenCommand.java Thu Sep  5 13:39:33 2013
@@ -19,8 +19,6 @@ package org.apache.sling.ide.impl.vlt;
 import javax.jcr.Credentials;
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -49,29 +47,10 @@ public class ListChildrenCommand extends
                 continue;
             }
 
-
             parent.addChild(nodeToResource(childNode));
         }
 
         return parent;
     }
 
-    private ResourceProxy nodeToResource(Node node) throws RepositoryException {
-
-        ResourceProxy resource = new ResourceProxy(node.getPath());
-        PropertyIterator properties = node.getProperties();
-        while (properties.hasNext()) {
-            Property property = properties.nextProperty();
-            String propertyName = property.getName();
-            Object propertyValue = ConversionUtils.getPropertyValue(property);
-
-            if (propertyValue != null) {
-                resource.addProperty(propertyName, propertyValue);
-            }
-        }
-
-        return resource;
-
-    }
-
 }

Added: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/RepositoryUtils.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/RepositoryUtils.java?rev=1520302&view=auto
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/RepositoryUtils.java (added)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/RepositoryUtils.java Thu Sep  5 13:39:33 2013
@@ -0,0 +1,60 @@
+/*
+ * 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.net.URISyntaxException;
+
+import javax.jcr.Credentials;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.jackrabbit.vault.fs.api.RepositoryAddress;
+import org.apache.jackrabbit.vault.util.RepositoryProvider;
+import org.apache.sling.ide.transport.RepositoryInfo;
+
+public abstract class RepositoryUtils {
+
+    private static final RepositoryProvider REPOSITORY_PROVIDER = new RepositoryProvider();
+
+    public static Repository getRepository(RepositoryInfo repositoryInfo) throws RepositoryException {
+
+        return REPOSITORY_PROVIDER.getRepository(getRepositoryAddress(repositoryInfo));
+    }
+
+    public static RepositoryAddress getRepositoryAddress(RepositoryInfo repositoryInfo) {
+        RepositoryAddress address;
+        try {
+            // TODO proper error handling
+            String url = repositoryInfo.getUrl() + "server/-/jcr:root/";
+            // TODO this should be configurable, or even better - automatically discovered
+            address = new RepositoryAddress(url);
+        } catch (URISyntaxException e) {
+            throw new RuntimeException(e);
+        }
+        return address;
+    }
+
+    public static Credentials getCredentials(RepositoryInfo repositoryInfo) {
+
+        return new SimpleCredentials(repositoryInfo.getUsername(), repositoryInfo.getPassword().toCharArray());
+    }
+
+    private RepositoryUtils() {
+
+    }
+}

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

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

Copied: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocator.java (from r1514762, sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java)
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocator.java?p2=sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocator.java&p1=sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java&r1=1514762&r2=1520302&rev=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocator.java Thu Sep  5 13:39:33 2013
@@ -14,21 +14,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.ide.serialization;
+package org.apache.sling.ide.impl.vlt;
 
 import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
 
-public interface SerializationManager {
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 
-    boolean isSerializationFile(String filePath);
+import org.apache.jackrabbit.vault.fs.api.RepositoryAddress;
+import org.apache.jackrabbit.vault.fs.api.VaultFileSystem;
 
-    String getBaseResourcePath(String serializationFilePath);
-
-    String getSerializationFilePath(String baseFilePath);
+/**
+ * The <tt>VaultFsLocator</tt> locates {@linkplain VaultFileSystem} instances
+ * 
+ */
+public interface VaultFsLocator {
 
-    String buildSerializationData(Map<String, Object> content) throws IOException;
+    VaultFileSystem getFileSystem(RepositoryAddress repositoryAddress, Session session)
+            throws RepositoryException, IOException;
 
-    Map<String, Object> readSerializationData(InputStream source) throws IOException;
 }

Copied: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocatorImpl.java (from r1514762, sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java)
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocatorImpl.java?p2=sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocatorImpl.java&p1=sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java&r1=1514762&r2=1520302&rev=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/api/src/org/apache/sling/ide/serialization/SerializationManager.java (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/VaultFsLocatorImpl.java Thu Sep  5 13:39:33 2013
@@ -14,21 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.ide.serialization;
+package org.apache.sling.ide.impl.vlt;
 
 import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
 
-public interface SerializationManager {
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 
-    boolean isSerializationFile(String filePath);
+import org.apache.jackrabbit.vault.fs.Mounter;
+import org.apache.jackrabbit.vault.fs.api.RepositoryAddress;
+import org.apache.jackrabbit.vault.fs.api.VaultFileSystem;
+
+public class VaultFsLocatorImpl implements VaultFsLocator {
+
+    @Override
+    public VaultFileSystem getFileSystem(RepositoryAddress repositoryAddress, Session session)
+            throws RepositoryException, IOException {
+
+        // TODO - supply filter and config
+        return Mounter.mount(null, null, repositoryAddress, "/", session);
+    }
 
-    String getBaseResourcePath(String serializationFilePath);
-
-    String getSerializationFilePath(String baseFilePath);
-
-    String buildSerializationData(Map<String, Object> content) throws IOException;
-
-    Map<String, Object> readSerializationData(InputStream source) throws IOException;
 }

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=1520302&r1=1520301&r2=1520302&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 Thu Sep  5 13:39:33 2013
@@ -1,14 +1,10 @@
 package org.apache.sling.ide.impl.vlt;
 
-import java.net.URISyntaxException;
 import java.util.Map;
 
 import javax.jcr.Credentials;
 import javax.jcr.RepositoryException;
-import javax.jcr.SimpleCredentials;
 
-import org.apache.jackrabbit.vault.fs.api.RepositoryAddress;
-import org.apache.jackrabbit.vault.util.RepositoryProvider;
 import org.apache.sling.ide.transport.Command;
 import org.apache.sling.ide.transport.FileInfo;
 import org.apache.sling.ide.transport.Repository;
@@ -27,8 +23,6 @@ public class VltRepository implements Re
     private javax.jcr.Repository jcrRepo;
 
     private EventAdmin eventAdmin;
-
-    private final RepositoryProvider rp = new RepositoryProvider();
     private Credentials credentials;
 
     @Override
@@ -39,18 +33,14 @@ public class VltRepository implements Re
         initJcrRepo();
     }
 
+    public RepositoryInfo getRepositoryInfo() {
+        return repositoryInfo;
+    }
+
     private void initJcrRepo() {
         try {
-            // TODO proper error handling
-            String url = repositoryInfo.getUrl()+ "server/-/jcr:root/";
-            // TODO this should be configurable, or even better - automatically discovered
-            RepositoryAddress repositoryAddress = new RepositoryAddress(url);
-            jcrRepo = rp.getRepository(repositoryAddress);
-
-            credentials = new SimpleCredentials(repositoryInfo.getUsername(), repositoryInfo.getPassword()
-                    .toCharArray());
-        } catch (URISyntaxException e) {
-            throw new RuntimeException(e);
+            jcrRepo = RepositoryUtils.getRepository(repositoryInfo);
+            credentials = RepositoryUtils.getCredentials(repositoryInfo);
         } catch (RepositoryException e) {
             throw new RuntimeException(e);
         }
@@ -81,7 +71,7 @@ public class VltRepository implements Re
     }
 
     @Override
-    public Command<Map<String, Object>> newGetNodeContentCommand(String path) {
+    public Command<ResourceProxy> newGetNodeContentCommand(String path) {
 
         return TracingCommand.wrap(new GetNodeContentCommand(jcrRepo, credentials, path), eventAdmin);
     }

Added: sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java?rev=1520302&view=auto
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java (added)
+++ sling/branches/tooling-ide-vlt/tooling/ide/impl-vlt/src/org/apache/sling/ide/impl/vlt/serialization/VltSerializationManager.java Thu Sep  5 13:39:33 2013
@@ -0,0 +1,122 @@
+/*
+ * 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.serialization;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Map;
+
+import javax.jcr.Credentials;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.jackrabbit.vault.fs.api.Aggregate;
+import org.apache.jackrabbit.vault.fs.api.RepositoryAddress;
+import org.apache.jackrabbit.vault.fs.api.VaultFile;
+import org.apache.jackrabbit.vault.fs.api.VaultFileSystem;
+import org.apache.jackrabbit.vault.fs.impl.io.DocViewSerializer;
+import org.apache.jackrabbit.vault.util.Constants;
+import org.apache.sling.ide.impl.vlt.RepositoryUtils;
+import org.apache.sling.ide.impl.vlt.VaultFsLocator;
+import org.apache.sling.ide.serialization.SerializationManager;
+import org.apache.sling.ide.transport.RepositoryInfo;
+import org.apache.sling.ide.transport.ResourceProxy;
+
+public class VltSerializationManager implements SerializationManager {
+
+    private VaultFsLocator fsLocator;
+
+    @Override
+    public boolean isSerializationFile(String filePath) {
+        return new File(filePath).getName().equals(Constants.DOT_CONTENT_XML);
+    }
+
+    @Override
+    public String getBaseResourcePath(String serializationFilePath) {
+        // TODO
+        return null;
+    }
+
+    @Override
+    public String getSerializationFilePath(String baseFilePath) {
+        // TODO - validate if this is correct
+        return baseFilePath + File.separatorChar + Constants.DOT_CONTENT_XML;
+    }
+
+    protected void bindVaultFsLocator(VaultFsLocator fsLocator) {
+
+        this.fsLocator = fsLocator;
+    }
+
+    protected void unbindVaultFsLocator(VaultFsLocator fsLocator) {
+
+        this.fsLocator = null;
+    }
+
+    @Override
+    public String buildSerializationData(ResourceProxy resource, RepositoryInfo repositoryInfo) throws IOException {
+
+        // TODO - there might be a performance problem with getting the session on-demand each time
+        Session session = null;
+        try {
+            
+            Repository repo = RepositoryUtils.getRepository(repositoryInfo);
+            Credentials credentials = RepositoryUtils.getCredentials(repositoryInfo);
+            
+            session = repo.login(credentials);
+
+            RepositoryAddress address = RepositoryUtils.getRepositoryAddress(repositoryInfo);
+
+            VaultFileSystem fs = fsLocator.getFileSystem(address, session);
+
+            VaultFile vaultFile = fs.getFile(resource.getPath());
+            if (vaultFile == null) {
+                // TODO proper logging ; discover if this is expected or not
+                System.err.println("No vaultFile at path " + resource.getPath());
+                return null;
+            }
+
+            Aggregate aggregate = vaultFile.getAggregate();
+            if (aggregate == null)
+                throw new IllegalArgumentException("No aggregate found for path " + resource.getPath());
+
+            DocViewSerializer s = new DocViewSerializer(aggregate);
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            s.writeContent(out);
+            
+            String stringResult = out.toString("UTF-8");
+            if (stringResult.isEmpty())
+                return null;
+            return stringResult;
+
+        } catch (RepositoryException e) {
+            throw new RuntimeException(e);
+        } finally {
+            if (session != null) {
+                session.logout();
+            }
+        }
+    }
+
+    @Override
+    public Map<String, Object> readSerializationData(InputStream source) throws IOException {
+        return null;
+    }
+}

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

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

Modified: sling/branches/tooling-ide-vlt/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target
URL: http://svn.apache.org/viewvc/sling/branches/tooling-ide-vlt/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target?rev=1520302&r1=1520301&r2=1520302&view=diff
==============================================================================
--- sling/branches/tooling-ide-vlt/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target (original)
+++ sling/branches/tooling-ide-vlt/tooling/ide/target-definition/org.apache.sling.ide.target-definition.target Thu Sep  5 13:39:33 2013
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="Sling IDE Tools" sequenceNumber="11">
+<?pde version="3.8"?><target name="Sling IDE Tools" sequenceNumber="13">
 <locations>
 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
 <unit id="org.eclipse.wst.server_adapters.feature.feature.group" version="3.2.100.v20110303-51EoAkF77g8HBSc"/>
@@ -10,6 +10,7 @@
 </location>
 <location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
 <unit id="org.json" version="1.0.0.v201011060100"/>
+<unit id="org.apache.commons.io" version="2.0.1.v201105210651"/>
 <unit id="org.slf4j.api" version="1.6.4.v20120130-2120"/>
 <unit id="ch.qos.logback.slf4j" version="1.0.0.v20120123-1500"/>
 <unit id="org.apache.commons.collections" version="3.2.0.v201005080500"/>

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=1520302&r1=1520301&r2=1520302&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 Thu Sep  5 13:39:33 2013
@@ -43,5 +43,9 @@ Import-Package: org.apache.commons.httpc
  org.apache.commons.httpclient.params;version="3.1.0",
  org.apache.commons.collections.map,
  org.apache.commons.collections.list,
+ org.apache.commons.logging,
+ org.apache.commons.codec,
+ org.apache.commons.io,
+ org.apache.commons.io.output,
  org.osgi.framework,
  org.slf4j



Mime
View raw message