sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject svn commit: r1527508 [3/4] - in /sling/trunk/tooling/ide: ./ api-test/ api/ api/META-INF/ api/OSGI-INF/ api/src/org/apache/sling/ide/filter/ api/src/org/apache/sling/ide/osgi/ api/src/org/apache/sling/ide/serialization/ api/src/org/apache/sling/ide/tra...
Date Mon, 30 Sep 2013 10:28:10 GMT
Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/GenericJcrRootFile.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/GenericJcrRootFile.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/GenericJcrRootFile.java (original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/GenericJcrRootFile.java Mon Sep 30 10:28:08 2013
@@ -17,38 +17,35 @@
 package org.apache.sling.ide.eclipse.ui.nav.model;
 
 import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
 
+import org.apache.commons.io.IOUtils;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.NullProgressMonitor;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 import org.xml.sax.SAXException;
 
+import de.pdark.decentxml.Document;
+import de.pdark.decentxml.Element;
+import de.pdark.decentxml.XMLParser;
+import de.pdark.decentxml.XMLSource;
+import de.pdark.decentxml.XMLStringSource;
+import de.pdark.decentxml.XMLTokenizer;
+import de.pdark.decentxml.XMLTokenizer.Type;
+
 /** WIP: model object for a [.content.xml] shown in the content package view in project explorer **/
 public class GenericJcrRootFile extends JcrNode {
 
 	final IFile file;
 	private final Document document;
 
-	public GenericJcrRootFile(JcrNode parent, IFile file) throws ParserConfigurationException, SAXException, IOException, CoreException {
+	public GenericJcrRootFile(JcrNode parent, final IFile file) throws ParserConfigurationException, SAXException, IOException, CoreException {
 		if (file==null) {
 			throw new IllegalArgumentException("file must not be null");
 		}
@@ -58,11 +55,20 @@ public class GenericJcrRootFile extends 
 			throw new IllegalArgumentException("parent must not be null");
 		}
 		this.parent = parent;
-		this.domNode = null;
+		this.domElement = null;
 		
-		DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-		this.document = docBuilder.parse(file.getContents());
-		handleJcrRoot(this.document.getFirstChild());
+		XMLParser parser = new XMLParser () {
+			@Override
+			protected XMLTokenizer createTokenizer(XMLSource source) {
+				XMLTokenizer tolerantTokenizerIgnoringEntities = new TolerantXMLTokenizer(source, file);
+				tolerantTokenizerIgnoringEntities.setTreatEntitiesAsText (this.isTreatEntitiesAsText());
+		        return tolerantTokenizerIgnoringEntities;
+			}
+		};
+		InputStream in = file.getContents();
+		String xml = IOUtils.toString(in);
+		this.document = parser.parse (new XMLStringSource (xml));	
+		handleJcrRoot(this.document.getRootElement());
 	}
 	
 	@Override
@@ -78,20 +84,30 @@ public class GenericJcrRootFile extends 
 		}
 		return false;
 	}
-
-	private void handleJcrRoot(Node domNode) {
-		NodeList children = domNode.getChildNodes();
+	
+	private void handleJcrRoot(Element element) {
+		List<Element> children = element.getChildren();
 		final JcrNode effectiveParent;
 		if (isRootContentXml()) {
-			handleProperties(domNode, parent.properties);
-			effectiveParent = parent;
+			if (parent instanceof DirNode) {
+				DirNode dirNodeParent = (DirNode)parent;
+				JcrNode dirNodeParentParent = dirNodeParent.getParent();
+				JcrNode effectiveSibling = dirNodeParent.getEffectiveSibling();
+				handleProperties(element, effectiveSibling.properties);
+				effectiveParent = parent;
+				dirNodeParentParent.hide(parent);
+			} else {
+				handleProperties(element, parent.properties);
+				effectiveParent = parent;
+			}
 		} else {
-			handleProperties(domNode, properties);
+			handleProperties(element, properties);
 			effectiveParent = this;
 			parent.addChild(this);
 		}
-		for(int i=0; i<children.getLength(); i++) {
-			handleChild(effectiveParent, children.item(i));
+		for (Iterator<Element> it = children.iterator(); it.hasNext();) {
+			Element aChild = it.next();
+			handleChild(effectiveParent, aChild);
 		}
 	}
 
@@ -99,7 +115,7 @@ public class GenericJcrRootFile extends 
 		return file.getName().equals(".content.xml");
 	}
 	
-	private void handleProperties(Node domNode, ModifiableProperties properties) {
+	private void handleProperties(Element domNode, ModifiableProperties properties) {
 		properties.setNode(this, domNode);
 //		NamedNodeMap attributes = domNode.getAttributes();
 //		for(int i=0; i<attributes.getLength(); i++) {
@@ -134,24 +150,17 @@ public class GenericJcrRootFile extends 
 		}
 	}
 
-	private void handleChild(JcrNode parent, Node domNode) {
-		if (domNode.getNodeType() == Node.TEXT_NODE) {
+	private void handleChild(JcrNode parent, Element domNode) {
+		if (domNode.getType() == Type.TEXT) {
 			// ignore
 			return;
 		}
-		if (domNode.getAttributes().getLength() == 0) {
-			// then ignore this empty node 
-			// either there is a file or a folder corresponding to this element
-			// (in which case it will show up again anyway) 
-			// or just an empty node without any further attributes such
-			// as primaryType doesn't help a lot
-			return;
-		}
 		JcrNode childJcrNode = new JcrNode(parent, domNode, this, null);
 		handleProperties(domNode, childJcrNode.properties);
-		NodeList children = domNode.getChildNodes();
-		for(int i=0; i<children.getLength(); i++) {
-			handleChild(childJcrNode, children.item(i));
+		List<Element> children = domNode.getChildren();
+		for (Iterator<Element> it = children.iterator(); it.hasNext();) {
+			Element element = it.next();
+			handleChild(childJcrNode, element);
 		}
 	}
 
@@ -185,28 +194,13 @@ public class GenericJcrRootFile extends 
 	
 	@Override
 	public void createChild(String nodeName) {
-		Element element = document.createElement(nodeName);
-		element.setAttribute("jcr:primaryType", "nt:unstructured");
-		Node childDomNode = document.getFirstChild().appendChild(element);
-		JcrNode childNode = new JcrNode(this, childDomNode, null);
-		underlying.save();
+		createChild(nodeName, document.getRootElement());
 	}
 	
 	public void save() {
 		try {
-			TransformerFactory transformerFactory = TransformerFactory.newInstance();
-			Transformer transformer = transformerFactory.newTransformer();
-			DOMSource source = new DOMSource(document);
-			ByteArrayOutputStream out = new ByteArrayOutputStream();
-			StreamResult result = new StreamResult(out);
-			transformer.transform(source, result);
-			file.setContents(new ByteArrayInputStream(out.toByteArray()), true, true, new NullProgressMonitor());
-		} catch (TransformerConfigurationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (TransformerException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
+			String xml = document.toXML();
+			file.setContents(new ByteArrayInputStream(xml.getBytes()), true, true, new NullProgressMonitor());
 		} catch (CoreException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java (original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/JcrNode.java Mon Sep 30 10:28:08 2013
@@ -20,20 +20,20 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
+import org.apache.jackrabbit.util.ISO9075;
+import org.apache.sling.ide.eclipse.core.ISlingLaunchpadServer;
+import org.apache.sling.ide.eclipse.core.ProjectUtil;
 import org.apache.sling.ide.eclipse.ui.WhitelabelSupport;
-import org.eclipse.core.resources.IContainer;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
@@ -47,7 +47,6 @@ import org.eclipse.core.runtime.IProgres
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IActionFilter;
@@ -56,13 +55,19 @@ import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.model.WorkbenchLabelProvider;
 import org.eclipse.ui.views.properties.IPropertySource;
 import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
+import org.eclipse.wst.server.core.IServer;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.DefaultHandler;
 
+import de.pdark.decentxml.Element;
+import de.pdark.decentxml.Namespace;
+import de.pdark.decentxml.Node;
+import de.pdark.decentxml.Text;
+import de.pdark.decentxml.XMLParseException;
+import de.pdark.decentxml.XMLTokenizer.Type;
+
 /** WIP: model object for a jcr node shown in the content package view in project explorer **/
 public class JcrNode implements IAdaptable {
 
@@ -98,9 +103,9 @@ public class JcrNode implements IAdaptab
 
 	JcrNode parent;
 
-	final Set<JcrNode> children = new HashSet<JcrNode>();
+	final List<JcrNode> children = new LinkedList<JcrNode>();
 
-	Node domNode;
+	Element domElement;
 
 	private IResource resource;
 	
@@ -119,18 +124,18 @@ public class JcrNode implements IAdaptab
 		}
 	}
 	
-	JcrNode(JcrNode parent, Node domNode, IResource resource) {
-		this(parent, domNode, parent.underlying, resource);
+	JcrNode(JcrNode parent, Element domElement, IResource resource) {
+		this(parent, domElement, parent.underlying, resource);
 	}
 	
 	
-	JcrNode(JcrNode parent, Node domNode, GenericJcrRootFile underlying, IResource resource) {
+	JcrNode(JcrNode parent, Element domElement, GenericJcrRootFile underlying, IResource resource) {
 		if (parent == null) {
 			throw new IllegalArgumentException("parent must not be null");
 		}
 		this.parent = parent;
-		// domNode can be null
-		this.domNode = domNode;
+		// domElement can be null
+		this.domElement = domElement;
 		this.underlying = underlying;
 		this.resource = resource;
 		parent.addChild(this);
@@ -138,23 +143,26 @@ public class JcrNode implements IAdaptab
 	
 	@Override
 	public String toString() {
-		return "JcrNode[dom:"+domNode+", file:"+resource+"]";
+		return "JcrNode[dom:"+domElement+", file:"+resource+", jcrPath:"+getJcrPath()+"]";
 	}
 	
 	@Override
 	public int hashCode() {
 		if (underlying==null) {
 			if (resource==null) {
-				if (domNode==null) {
+				if (domElement==null) {
 					return toString().hashCode();
 				} else {
-					return domNode.toString().hashCode() + parent.hashCode();
+					return domElement.toString().hashCode() + parent.hashCode();
 				}
 			} else {
 				return resource.getFullPath().hashCode();
 			}
 		} else {
-			return underlying.hashCode() + domNode.toString().hashCode();
+			if (domElement==null) {
+				return underlying.hashCode();
+			}
+			return underlying.hashCode() + domElement.toString().hashCode();
 		}
 	}
 	
@@ -167,14 +175,6 @@ public class JcrNode implements IAdaptab
 			return false;
 		}
 		JcrNode other = (JcrNode) obj;
-		if (other.underlying==null && underlying!=null) {
-			return false;
-		} else if (other.underlying!=null && underlying==null) {
-			return false;
-		}
-		if (underlying!=null && !underlying.equals(other.underlying)) {
-			return false;
-		}
 		if (resource!=null && other.resource!=null) {
 			if (resource.equals(other.resource)) {
 				return true;
@@ -186,25 +186,45 @@ public class JcrNode implements IAdaptab
 		} else if (resource==null && other.resource!=null) {
 			return false;
 		}
+		if (other.underlying==null && underlying!=null) {
+			return false;
+		} else if (other.underlying!=null && underlying==null) {
+			return false;
+		}
+		if (underlying!=null && !underlying.equals(other.underlying)) {
+			return false;
+		}
 		if (parent!=null && other.parent!=null) {
 			if (!parent.equals(other.parent)) {
 				return false;
 			}
-			return domNode.toString().equals(other.domNode.toString());
+			return domElement.toString().equals(other.domElement.toString());
 		}
 		return toString().equals(obj.toString());
 	}
 
 	protected void addChild(JcrNode jcrNode) {
-		children.add(jcrNode);
+		if (!children.contains(jcrNode)) {
+			// check to see if there is a same-named node though
+			// that is the dom/resource case
+			for (Iterator<JcrNode> it = children.iterator(); it.hasNext();) {
+				JcrNode existingChild = it.next();
+				if (existingChild.getName().equals(jcrNode.getName())) {
+					// then merge the two
+					existingChild.setResource(jcrNode.resource);
+					return;
+				}
+			}
+			children.add(jcrNode);
+		}
 	}
 
 	/** shown in the navigator (project explorer) as the label of this element **/
 	public String getLabel() {
-		if (domNode!=null && resource!=null) {
-			return domNode.getNodeName();// + "[domnode+file]";
-		} else if (domNode!=null && resource==null) {
-			return domNode.getNodeName();// + "[domnode]";
+		if (domElement!=null && resource!=null) {
+			return ISO9075.decode(getDomName());// + "[domnode+file]";
+		} else if (domElement!=null && resource==null) {
+			return ISO9075.decode(getDomName());// + "[domnode]";
 		} else if (resource!=null) {
 			return resource.getName();//+" [file]";
 		} else {
@@ -231,26 +251,60 @@ public class JcrNode implements IAdaptab
 		hiddenChildren.add(node);
 	}
 
-	Object[] filterHiddenChildren(final Collection<JcrNode> collection) {
-		final Collection<JcrNode> values = new HashSet<JcrNode>(collection);
+	Object[] filterHiddenChildren(final Collection<JcrNode> collection, boolean hideEmptyNodes) {
+		final Collection<JcrNode> values = new LinkedList<JcrNode>(collection);
 		
 		for (Iterator<JcrNode> it = hiddenChildren.iterator(); it.hasNext();) {
 			final JcrNode hiddenNode = it.next();
 			values.remove(hiddenNode);
 		}
+		if (hideEmptyNodes) {
+			for (Iterator<JcrNode> it = values.iterator(); it.hasNext();) {
+				JcrNode jcrNode = it.next();
+				if (jcrNode.isEmptyNode()) {
+					it.remove();
+				}
+			}
+		}
 		
 		return values.toArray();
 	}
 	
-	public Object[] getChildren() {
+	private boolean isEmptyNode() {
+		if (resource!=null) {
+			return false;
+		}
+		if (children.size()!=0) {
+			return false;
+		}
+		if (domElement==null) {
+			return true;
+		}
+		if (domElement.hasChildren()) {
+			return false;
+		}
+		if (domElement.getAttributes().size()!=0) {
+			return false;
+		}
+		return true;
+	}
+
+	public Object[] getChildren(boolean hideEmptyNodes) {
+		if (!resourceChildrenAdded) {
+			initChildren();
+		}
+		return filterHiddenChildren(children, true);
+	}
+	
+	void initChildren() {
 		try {
 			if (resourceChildrenAdded) {
-				return filterHiddenChildren(children);
+				throw new IllegalStateException("Children already loaded");
 			}
-			Map<String,JcrNode> resultMap = new HashMap<String, JcrNode>();
+			Set<String> childrenNames = new HashSet<String>();
 			for (Iterator it = children.iterator(); it.hasNext();) {
 				JcrNode node = (JcrNode) it.next();
-				resultMap.put(node.getName(), node);
+				childrenNames.add(node.getName());
 			}
 			
 			if (resource!=null && resource instanceof IFolder) {
@@ -271,45 +325,44 @@ public class JcrNode implements IAdaptab
 							for (Iterator it3 = children.iterator(); it3
 									.hasNext();) {
 								JcrNode node = (JcrNode) it3.next();
-								if (!resultMap.containsKey(node.getName())) {
-									resultMap.put(node.getName(), node);
+								if (!childrenNames.contains(node.getName())) {
+									childrenNames.add(node.getName());
 								}
 							}
 							
 							continue outerLoop;
 						}
 					}
+					List<JcrNode> newNodes = new LinkedList<JcrNode>();
 					for (Iterator it = membersList.iterator(); it.hasNext();) {
 						IResource iResource = (IResource) it.next();
 						JcrNode node;
 						if (DirNode.isDirNode(iResource)) {
-							node = new DirNode(this, (Node)null, iResource);
+							node = new DirNode(this, (Element)null, iResource);
 						} else {
-							node = new JcrNode(this, (Node)null, iResource);
+							node = new JcrNode(this, (Element)null, iResource);
 						}
-//						node.setResource(iResource);
-						// load the children - to make sure we get vault files loaded too
-						node.getChildren();
-						resultMap.put(node.getName(), node);
+						childrenNames.add(node.getName());
+						newNodes.add(node);
 						it.remove();
 					}
+					for (Iterator<JcrNode> it = newNodes.iterator(); it
+							.hasNext();) {
+						JcrNode jcrNode = it.next();
+						// load the children - to make sure we get vault files loaded too
+						jcrNode.initChildren();
+					}
 				}
 			}
 			resourceChildrenAdded = true;
-			
-			return filterHiddenChildren(resultMap.values());
 		} catch (CoreException e) {
 			e.printStackTrace();
-			return new Object[0];
 		} catch (ParserConfigurationException e) {
 			e.printStackTrace();
-			return new Object[0];
 		} catch (SAXException e) {
 			e.printStackTrace();
-			return new Object[0];
 		} catch (IOException e) {
 			e.printStackTrace();
-			return new Object[0];
 		}
 	}
 
@@ -341,46 +394,48 @@ public class JcrNode implements IAdaptab
 	}
 
 	public Image getImage() {
-		if (resource!=null) {
-			if (resource instanceof IFolder) {
-				Image folderImage = workbenchLabelProvider.getImage(resource);
-				if (domNode==null && false) {
-					// then make it greyscale
-					folderImage = new
-							Image(folderImage.getDevice(), folderImage,SWT.IMAGE_GRAY);
-				}
-				return folderImage;
-			} else
-				try {
-					if (!isVaultFile(resource)){
-						final String jcrMimeType = getJcrContentProperty("jcr:mimeType");
-						if (jcrMimeType!=null && jcrMimeType.length()!=0) {
-							ImageDescriptor desc = getImageDescriptor(resource.getName(), jcrMimeType);
-							if (desc!=null) {
-								return desc.createImage();
-							}
-						}
-						return workbenchLabelProvider.getImage(resource);
-					}
-				} catch (ParserConfigurationException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				} catch (SAXException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				} catch (IOException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				} catch (CoreException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
+		boolean plainFolder = resource!=null && (resource instanceof IFolder);
+		String primaryType = getProperty("jcr:primaryType");
+		boolean typeFolder = primaryType!=null && ((primaryType.equals("nt:folder") || primaryType.equals("sling:Folder")));
+		boolean typeFile = primaryType!=null && ((primaryType.equals("nt:file") || primaryType.equals("nt:resource") || primaryType.equals("sling:File")));
+		typeFile |= (resource!=null && primaryType==null);
+		boolean typeUnstructured = primaryType!=null && ((primaryType.equals("nt:unstructured")));
+		
+		boolean isVaultFile = false;
+		try {
+			isVaultFile = resource!=null && isVaultFile(resource);
+		} catch (Exception e) {
+			// this empty catch is okay
+		}
+		
+		String mimeType = null;
+		mimeType = getJcrContentProperty("jcr:mimeType");
+		if (mimeType == null) {
+			mimeType = getProperty("jcr:mimeType");
+		}
+		
+		if (typeUnstructured) {
+			return WhitelabelSupport.JCR_NODE_ICON.createImage();
+		} else if (plainFolder || typeFolder) {
+			return workbenchLabelProvider.getImage(ProjectUtil.getSyncDirectory(getProject()));
+		} else if (typeFile && resource!=null) {
+			if (mimeType!=null && mimeType.length()!=0) {
+				ImageDescriptor desc = getImageDescriptor(resource.getName(), mimeType);
+				if (desc!=null) {
+					return desc.createImage();
 				}
+			}
+			if (isVaultFile) {
+				return WhitelabelSupport.JCR_NODE_ICON.createImage();
+			}
+			return workbenchLabelProvider.getImage(resource);
+		} else {
+			if (resource!=null && !isVaultFile) {
+				return workbenchLabelProvider.getImage(resource);
+			}
+			return WhitelabelSupport.JCR_NODE_ICON.createImage();
 		}
-		//if (domNode!=null && children!=null && children.size()>0) {
-		//	return workbenchLabelProvider.getImage(domNode);
-		//}
 		
-		return WhitelabelSupport.JCR_NODE_ICON.createImage();
 	}
 
 	private ImageDescriptor getImageDescriptor(String filename, String jcrMimeType) {
@@ -396,30 +451,47 @@ public class JcrNode implements IAdaptab
 	}
 
 	private String getJcrContentProperty(String propertyKey) {
-		final Object[] chldrn = getChildren();
+		final Object[] chldrn = getChildren(false);
 		for (int i = 0; i < chldrn.length; i++) {
 			JcrNode jcrNode = (JcrNode) chldrn[i];
 			if ("jcr:content".equals(jcrNode.getName())) {
-				if (jcrNode.properties!=null) {
-					Object propertyValue = jcrNode.properties.getValue(propertyKey);
-					if (propertyValue!=null) {
-						return String.valueOf(propertyValue);
-					}
-				}
+				return jcrNode.getProperty(propertyKey);
+			}
+		}
+		return null;
+	}
+
+	private String getProperty(String propertyKey) {
+		if (properties!=null) {
+			Object propertyValue = properties.getValue(propertyKey);
+			if (propertyValue!=null) {
+				return String.valueOf(propertyValue);
 			}
 		}
 		return null;
 	}
 
 	public String getName() {
-		if (domNode!=null) {
-			return domNode.getNodeName();
+		if (domElement!=null) {
+			return ISO9075.decode(getDomName());
 		} else if (resource!=null) {
 			return resource.getName();
 		} else {
 			return "";
 		}
 	}
+
+	private String getDomName() {
+		String domName = domElement.getName();
+		Namespace ns = domElement.getNamespace();
+		if (ns!=null) {
+			String prefix = ns.getPrefix();
+			if (!prefix.isEmpty()) {
+				domName = prefix + ":" + domName;
+			}
+		}
+		return domName;
+	}
 		
 	String getJcrPath() {
 		String prefix;
@@ -431,7 +503,11 @@ public class JcrNode implements IAdaptab
 				prefix = prefix + "/";
 			}
 		}
-		return prefix + getName();
+		return prefix + getJcrPathName();
+	}
+
+	String getJcrPathName() {
+		return getName();
 	}
 
 	@Override
@@ -454,10 +530,13 @@ public class JcrNode implements IAdaptab
 					}
 					final JcrNode node = (JcrNode)target;
 					if ("domNode".equals(name)) {
-						return node.domNode!=null;	
+						return node.domElement!=null;	
 					}
 					if ("nonDomNode".equals(name)) {
-						return node.domNode==null;	
+						return node.domElement==null;	
+					}
+					if ("browseableNode".equals(name)) {
+						return node.isBrowsable();
 					}
 					return false;
 				}
@@ -553,13 +632,21 @@ public class JcrNode implements IAdaptab
 		return null;
 	}
 
+	protected boolean isBrowsable() {
+		return true;
+	}
+
 	public IFile getFileForEditor() {
 		if (resource instanceof IFile) {
 //			if (!isVaultFile(resource)) {
 			return (IFile)resource;
-		} else if (resource instanceof IContainer) {
-			return null;
-		} else if (underlying!=null && underlying.file!=null) {
+		} else if (underlying!=null && underlying.file!=null && domElement!=null) {
+			if (properties!=null) {
+				GenericJcrRootFile propUnderlying = properties.getUnderlying();
+				if (propUnderlying!=null) {
+					return propUnderlying.file;
+				}
+			}
 			return underlying.file;
 		} else {
 			return null;
@@ -567,8 +654,8 @@ public class JcrNode implements IAdaptab
 	}
 
 	public void rename(String string) {
-		if (domNode!=null && underlying!=null) {
-			domNode.getOwnerDocument().renameNode(domNode, domNode.getNamespaceURI(), string);
+		if (domElement!=null && underlying!=null) {
+			domElement.setName(string);
 			underlying.save();
 		}
 	}
@@ -577,8 +664,8 @@ public class JcrNode implements IAdaptab
 		if (resource!=null) {
 			return false;
 		}
-		if (domNode!=null && underlying!=null) {
-			if (domNode.getNodeName().equals("jcr:content")) {
+		if (domElement!=null && underlying!=null) {
+			if (getDomName().equals("jcr:content")) {
 				return false;
 			}
 			return true;
@@ -589,16 +676,26 @@ public class JcrNode implements IAdaptab
 	public JcrNode getParent() {
 		return parent;
 	}
-	
+
+	JcrNode getChild(String name) {
+		for (Iterator<JcrNode> it = children.iterator(); it.hasNext();) {
+			JcrNode aChild = it.next();
+			if (aChild.getName().equals(name)) {
+				return aChild;
+			}
+		}
+		return null;
+	}
+
 	IResource getResource() {
 		return resource;
 	}
 
 	public void createChild(String nodeName) {
-		if (domNode==null) {
+		if (domElement==null) {
 			// then we're not in the context of a .content.xml file yet
 			// so we need to create one
-			final String minimalContentXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><jcr:root xmlns:sling=\"http://sling.apache.org/jcr/sling/1.0\" xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"/>";
+			final String minimalContentXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<jcr:root\n    xmlns:sling=\"http://sling.apache.org/jcr/sling/1.0\"\n    xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"/>";
 			if (resource instanceof IFolder) {
 				IFolder folder = (IFolder)resource;
 				IFile file = folder.getFile(nodeName+".xml");
@@ -614,27 +711,85 @@ public class JcrNode implements IAdaptab
 			}
 		} else {
 			try{
-				Element element = domNode.getOwnerDocument().createElement(nodeName);
-				element.setAttribute("jcr:primaryType", "nt:unstructured");
-				Node childDomNode = domNode.appendChild(element);
-				JcrNode childNode = new JcrNode(this, childDomNode, null);
-				underlying.save();
+				createChild(nodeName, domElement);
 			} catch(Exception e) {
 				MessageDialog.openError(Display.getDefault().getActiveShell(), "Error creating new JCR node", "The following error occurred: "+e.getMessage());
 			}
 		}
 	}
 
+	protected void createChild(String nodeName,
+			Element domElement) {
+		if (domElement==null) {
+			throw new IllegalArgumentException("domNode must not be null");
+		}
+		if (underlying==null) {
+			throw new IllegalArgumentException("underlying must not be null");
+		}
+		Element element = new Element(nodeName);
+		element.addAttribute("jcr:primaryType", "nt:unstructured");
+		StringBuffer indent = new StringBuffer();
+		Element parElement = domElement.getParentElement();
+		while(parElement!=null) {
+			indent.append("    ");
+			parElement = parElement.getParentElement();
+		}
+		domElement.addNode(new Text("\n    "+indent.toString()));
+		element = domElement.addNode(element);
+		domElement.addNode(new Text("\n"+indent.toString()));
+		JcrNode childNode = new JcrNode(this, element, null);
+		underlying.save();
+	}
+
 	public void delete() {
 		if (parent==null) {
 			// then I dont know how to delete
 			return;
 		}
 		parent.children.remove(this);
-		if (domNode!=null) {
-			domNode.getParentNode().removeChild(domNode);
+		if (domElement!=null) {
+			Element parentNode = domElement.getParentElement();
+			domElement.remove();
+			if (parentNode!=null) {
+				List<Node> allChildNodes = parentNode.getNodes();
+				boolean nonTextChild = false;
+				for (Iterator<Node> it = allChildNodes.iterator(); it
+						.hasNext();) {
+					Node node = it.next();
+					if (node.getType()!=Type.TEXT) {
+						nonTextChild = true;
+					}					
+				}
+				if (!nonTextChild) {
+					for (Iterator<Node> it = allChildNodes.iterator(); it
+							.hasNext();) {
+						Node node = it.next();
+						it.remove();
+					}
+					if (!parentNode.hasNodes()) {
+						parentNode.setCompactEmpty(true);
+					}
+				}
+			}
 		}
 		underlying.save();
 	}
 
+	public IProject getProject() {
+		if (resource!=null) {
+			return resource.getProject();
+		}
+		if (underlying!=null) {
+			return underlying.file.getProject();
+		}
+		return null;
+	}
+
+	public String getURLForBrowser(IServer server) {
+		final String host = server.getHost();
+		final int port = server.getAttribute(ISlingLaunchpadServer.PROP_PORT, 8080);
+        final String url = "http://"+host+":"+port+""+getJcrPath();
+		return url;
+	}
+
 }

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/LinkHelper.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/LinkHelper.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/LinkHelper.java (original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/LinkHelper.java Mon Sep 30 10:28:08 2013
@@ -35,13 +35,17 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.ide.ResourceUtil;
 import org.eclipse.ui.navigator.ILinkHelper;
-import org.w3c.dom.Node;
+
+import de.pdark.decentxml.Element;
 
 public class LinkHelper implements ILinkHelper {
 
 	@Override
 	public IStructuredSelection findSelection(IEditorInput anInput) {
 		IFile file = ResourceUtil.getFile(anInput);
+        if (file == null) {
+            return null;
+        }
 		IProject project = file.getProject();
 		if (!ProjectHelper.isContentProject(project)) {
 			return null;
@@ -80,7 +84,7 @@ public class LinkHelper implements ILink
 		if (parent==null) {
 			return null;
 		}
-		Node domNode = null;
+		Element domNode = null;
 		JcrNode selectedNode = new JcrNode(parent, domNode, resource);
 		return selectedNode;
 	}

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/ModifiableProperties.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/ModifiableProperties.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/ModifiableProperties.java (original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/nav/model/ModifiableProperties.java Mon Sep 30 10:28:08 2013
@@ -25,14 +25,15 @@ import java.util.Map;
 import org.eclipse.ui.views.properties.IPropertyDescriptor;
 import org.eclipse.ui.views.properties.IPropertySource;
 import org.eclipse.ui.views.properties.TextPropertyDescriptor;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
+
+import de.pdark.decentxml.Attribute;
+import de.pdark.decentxml.Element;
 
 public class ModifiableProperties implements IPropertySource {
 	
 	private Map<String, String> properties = new HashMap<String, String>();
 	private JcrNode node;
-	private Node domNode;
+	private Element domElement;
 	private GenericJcrRootFile genericJcrRootFile;
 	
 	public ModifiableProperties(JcrNode node) {
@@ -46,6 +47,10 @@ public class ModifiableProperties implem
 		this.node = node;
 	}
 	
+	public GenericJcrRootFile getUnderlying() {
+		return genericJcrRootFile;
+	}
+	
 	@Override
 	public Object getEditableValue() {
 		return this;
@@ -86,19 +91,18 @@ public class ModifiableProperties implem
 	public void setPropertyValue(Object id, Object value) {
 		Map.Entry<String, String> entry = (Map.Entry<String, String>)id;
 		entry.setValue(String.valueOf(value));
-		NamedNodeMap attributes = domNode.getAttributes();
-		Node n = attributes.getNamedItem(entry.getKey());
-		n.setNodeValue(String.valueOf(value));
+		Attribute a = domElement.getAttribute(entry.getKey());
+		a.setValue(String.valueOf(value));
 		genericJcrRootFile.save();
 	}
 
-	public void setNode(GenericJcrRootFile genericJcrRootFile, Node domNode) {
-		this.domNode = domNode;
-		NamedNodeMap attributes = domNode.getAttributes();
+	public void setNode(GenericJcrRootFile genericJcrRootFile, Element domNode) {
+		this.domElement = domNode;
+		List<Attribute> attributes = domNode.getAttributes();
 		if (attributes!=null) {
-			for(int i=0; i<attributes.getLength(); i++) {
-				Node attr = attributes.item(i);
-				properties.put(attr.getNodeName(), attr.getNodeValue());
+			for (Iterator<Attribute> it = attributes.iterator(); it.hasNext();) {
+				Attribute a = it.next();
+				properties.put(a.getName(), a.getValue());
 			}
 		}
 		this.genericJcrRootFile = genericJcrRootFile;

Modified: sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/ConvertToBundleAction.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/ConvertToBundleAction.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/ConvertToBundleAction.java (original)
+++ sling/trunk/tooling/ide/eclipse-ui/src/org/apache/sling/ide/eclipse/ui/wizards/ConvertToBundleAction.java Mon Sep 30 10:28:08 2013
@@ -147,7 +147,7 @@ public class ConvertToBundleAction imple
 		fSelection = selection;
 		if (selection instanceof IStructuredSelection) {
 			final IStructuredSelection iss = (IStructuredSelection) selection;
-			Iterator<Object> it = iss.iterator();
+			Iterator<?> it = iss.iterator();
 			if (!it.hasNext()) {
 				action.setEnabled(false);
 				return;

Modified: sling/trunk/tooling/ide/feature/feature.xml
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/feature/feature.xml?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/feature/feature.xml (original)
+++ sling/trunk/tooling/ide/feature/feature.xml Mon Sep 30 10:28:08 2013
@@ -5,6 +5,210 @@
       version="0.0.1.qualifier"
       provider-name="The Apache Foundation">
 
+   <license url="http://www.apache.org/licenses/LICENSE-2.0">
+      Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      &quot;License&quot; shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      &quot;Licensor&quot; shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      &quot;Legal Entity&quot; shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      &quot;control&quot; means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      &quot;You&quot; (or &quot;Your&quot;) shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      &quot;Source&quot; form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      &quot;Object&quot; form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      &quot;Work&quot; shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      &quot;Derivative Works&quot; shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      &quot;Contribution&quot; shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, &quot;submitted&quot;
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as &quot;Not a Contribution.&quot;
+
+      &quot;Contributor&quot; shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a &quot;NOTICE&quot; text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an &quot;AS IS&quot; BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets &quot;[]&quot;
+      replaced with your own identifying information. (Don&apos;t include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same &quot;printed page&quot; as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+   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 &quot;AS IS&quot; 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.
+   </license>
+
    <plugin
          id="org.apache.sling.ide.api"
          download-size="0"
@@ -13,30 +217,80 @@
          unpack="false"/>
 
    <plugin
-         id="org.apache.sling.ide.impl-resource"
+         id="org.apache.sling.ide.eclipse-core"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.apache.sling.ide.eclipse-core"
+         id="org.apache.sling.ide.eclipse-ui"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.apache.sling.ide.eclipse-ui"
+         id="org.json"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
 
    <plugin
-         id="org.json"
+         id="org.apache.sling.ide.impl-vlt"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.apache.sling.ide.vlt-wrapper"
          download-size="0"
          install-size="0"
          version="0.0.0"
          unpack="false"/>
+
+   <plugin
+         id="org.apache.commons.io"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.apache.commons.collections"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.apache.commons.httpclient"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.apache.commons.logging"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.slf4j.api"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.apache.sling.ide.artifacts"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>

Modified: sling/trunk/tooling/ide/impl-resource-test/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource-test/pom.xml?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource-test/pom.xml (original)
+++ sling/trunk/tooling/ide/impl-resource-test/pom.xml Mon Sep 30 10:28:08 2013
@@ -42,18 +42,4 @@
           <scope>test</scope>
       </dependency>
   </dependencies>
-  
-  <build>
-      <plugins>
-          <plugin>
-              <groupId>org.apache.maven.plugins</groupId>
-              <artifactId>maven-compiler-plugin</artifactId>
-              <configuration>
-                <!-- Tycho targets 1.6 by default, so we need that as well -->
-                <source>1.6</source>
-                <target>1.6</target>
-              </configuration>
-          </plugin>
-      </plugins>
-  </build>
 </project>
\ No newline at end of file

Modified: sling/trunk/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java (original)
+++ sling/trunk/tooling/ide/impl-resource-test/src/test/java/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManagerTest.java Mon Sep 30 10:28:08 2013
@@ -1,3 +1,19 @@
+/*
+ * 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.resource.serialization;
 
 import static org.custommonkey.xmlunit.XMLAssert.assertXMLEqual;
@@ -5,13 +21,17 @@ import static org.hamcrest.CoreMatchers.
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.junit.Assert.assertThat;
 
+import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.StringReader;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.sling.ide.serialization.SerializationData;
+import org.apache.sling.ide.serialization.SerializationException;
+import org.apache.sling.ide.serialization.SerializationKind;
+import org.apache.sling.ide.transport.ResourceProxy;
 import org.custommonkey.xmlunit.XMLUnit;
 import org.junit.Before;
 import org.junit.BeforeClass;
@@ -34,40 +54,50 @@ public class SimpleXmlSerializationManag
     }
 
     @Test
-    public void emptySerializedData() throws IOException, SAXException {
+    public void emptySerializedData() throws SerializationException, SAXException {
 
-        String serializationData = sm.buildSerializationData(new HashMap<String, Object>());
+        SerializationData serializationData = sm.newBuilder(null, null).buildSerializationData(null,
+                newResourceWithProperties(new HashMap<String, Object>()));
 
         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 {
+    public void nullSerializedData() throws SerializationException, SAXException {
 
-        String serializationData = sm.buildSerializationData(null);
+        SerializationData serializationData = sm.newBuilder(null, null).buildSerializationData(null, null);
 
         assertThat(serializationData, is(nullValue()));
     }
 
     @Test
-    public void stringSerializedData() throws IOException, SAXException {
+    public void stringSerializedData() throws SerializationException, SAXException, IOException {
 
         Map<String, Object> data = new HashMap<String, Object>();
         data.put("jcr:createdBy", "admin");
         data.put("jcr:lastModifiedBy", "author");
 
-        String serializationData = sm.buildSerializationData(data);
+        SerializationData serializationData = sm.newBuilder(null, null).buildSerializationData(null, newResourceWithProperties(data));
 
         String methodName = "stringSerializedData";
 
-        assertXmlOutputIsEqualTo(serializationData, methodName);
+        assertXmlOutputIsEqualTo(serializationData.getContents(), methodName);
     }
 
-    private void assertXmlOutputIsEqualTo(String serializationData, String methodName) throws SAXException, IOException {
+    private void assertXmlOutputIsEqualTo(byte[] serializationData, String methodName) throws SAXException,
+            SerializationException, IOException {
 
         InputStream doc = readSerializationDataFile(methodName);
 
-        assertXMLEqual(new InputSource(doc), new InputSource(new StringReader(serializationData)));
+        assertXMLEqual(new InputSource(doc), new InputSource(new ByteArrayInputStream(serializationData)));
     }
 
     private InputStream readSerializationDataFile(String methodName) {
@@ -79,23 +109,23 @@ public class SimpleXmlSerializationManag
     }
 
     @Test
-    public void serializedDataIsEscaped() throws IOException, SAXException {
+    public void serializedDataIsEscaped() throws SerializationException, SAXException, IOException {
 
         Map<String, Object> data = new HashMap<String, Object>();
         data.put("jcr:description", "<p class=\"active\">Welcome</p>");
 
-        String serializationData = sm.buildSerializationData(data);
+        SerializationData serializationData = sm.newBuilder(null, null).buildSerializationData(null, newResourceWithProperties(data));
 
         String methodName = "serializedDataIsEscaped";
 
-        assertXmlOutputIsEqualTo(serializationData, methodName);
+        assertXmlOutputIsEqualTo(serializationData.getContents(), methodName);
     }
 
     @Test
     public void readSerializedData() throws IOException, SAXException {
 
         Map<String, Object> serializationData = sm
-                .readSerializationData(readSerializationDataFile("stringSerializedData"));
+                .readSerializationData(null, readSerializationDataFile("stringSerializedData")).getProperties();
 
         Map<String, Object> expected = new HashMap<String, Object>();
         expected.put("jcr:createdBy", "admin");
@@ -121,7 +151,7 @@ public class SimpleXmlSerializationManag
     @Test
     public void serializationFileLocation() {
         
-        String serializationFilePath = sm.getSerializationFilePath("jcr_root");
+        String serializationFilePath = sm.getSerializationFilePath("jcr_root", SerializationKind.FOLDER);
         
         assertThat(serializationFilePath, is("jcr_root" + File.separatorChar + ".content.xml"));
     }

Modified: sling/trunk/tooling/ide/impl-resource/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/META-INF/MANIFEST.MF?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/META-INF/MANIFEST.MF (original)
+++ sling/trunk/tooling/ide/impl-resource/META-INF/MANIFEST.MF Mon Sep 30 10:28:08 2013
@@ -3,8 +3,7 @@ Bundle-ManifestVersion: 2
 Bundle-Name: Slingclipse-http
 Bundle-SymbolicName: org.apache.sling.ide.impl-resource
 Bundle-Version: 0.0.1.qualifier
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
+Require-Bundle: org.eclipse.core.runtime,
  org.apache.sling.ide.api;bundle-version="0.0.1",
  org.apache.commons.httpclient;bundle-version="3.1.0",
  org.eclipse.equinox.ds;bundle-version="1.2.1",

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilter.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilter.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilter.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilter.java Mon Sep 30 10:28:08 2013
@@ -16,10 +16,12 @@
  */
 package org.apache.sling.ide.impl.resource.filer;
 
+import java.io.File;
 import java.util.List;
 
 import org.apache.sling.ide.filter.Filter;
 import org.apache.sling.ide.filter.FilterResult;
+import org.apache.sling.ide.transport.RepositoryInfo;
 
 public class SimpleFilter implements Filter {
 
@@ -30,7 +32,7 @@ public class SimpleFilter implements Fil
     }
 
     @Override
-    public FilterResult filter(String relativeFilePath) {
+    public FilterResult filter(File contentSyncRoot, String relativeFilePath, RepositoryInfo repositoryInfo) {
         if (relativeFilePath.isEmpty() || relativeFilePath.charAt(0) != '/') {
             relativeFilePath = '/' + relativeFilePath;
         }

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilterLocator.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilterLocator.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilterLocator.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/filer/SimpleFilterLocator.java Mon Sep 30 10:28:08 2013
@@ -53,12 +53,14 @@ public class SimpleFilterLocator impleme
     public Filter loadFilter(InputStream filterFileContents) throws IOException {
 
         List<String> filters = new ArrayList<String>();
-        BufferedReader reader = new BufferedReader(new InputStreamReader(filterFileContents));
-        String line;
-        while ((line = reader.readLine()) != null) {
-            if (line.charAt(0) == '#')
-                continue;
-            filters.add(line);
+        if (filterFileContents != null) {
+            BufferedReader reader = new BufferedReader(new InputStreamReader(filterFileContents));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                if (line.charAt(0) == '#')
+                    continue;
+                filters.add(line);
+            }
         }
 
         return new SimpleFilter(filters);

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/serialization/SimpleXmlSerializationManager.java Mon Sep 30 10:28:08 2013
@@ -16,10 +16,10 @@
  */
 package org.apache.sling.ide.impl.resource.serialization;
 
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.StringWriter;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -34,14 +34,20 @@ import javax.xml.transform.sax.SAXTransf
 import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.stream.StreamResult;
 
+import org.apache.sling.ide.serialization.SerializationData;
+import org.apache.sling.ide.serialization.SerializationDataBuilder;
+import org.apache.sling.ide.serialization.SerializationException;
+import org.apache.sling.ide.serialization.SerializationKind;
 import org.apache.sling.ide.serialization.SerializationManager;
+import org.apache.sling.ide.transport.Repository;
+import org.apache.sling.ide.transport.ResourceProxy;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;
 import org.xml.sax.helpers.DefaultHandler;
 
-public class SimpleXmlSerializationManager implements SerializationManager {
+public class SimpleXmlSerializationManager implements SerializationManager, SerializationDataBuilder {
 
     private static final String TAG_PROPERTY = "property";
     private static final String ATT_PROPERTY_NAME = "name";
@@ -55,7 +61,7 @@ public class SimpleXmlSerializationManag
     }
 
     @Override
-    public String getSerializationFilePath(String baseFilePath) {
+    public String getSerializationFilePath(String baseFilePath, SerializationKind serializationKind) {
         return baseFilePath + File.separatorChar + CONTENT_XML;
     }
 
@@ -74,7 +80,7 @@ public class SimpleXmlSerializationManag
     }
 
     @Override
-    public Map<String, Object> readSerializationData(InputStream source) throws IOException {
+    public ResourceProxy readSerializationData(String filePath, InputStream source) throws IOException {
 
         try {
             SAXParserFactory factory = SAXParserFactory.newInstance();
@@ -84,7 +90,7 @@ public class SimpleXmlSerializationManag
 
             saxParser.parse(new InputSource(source), h);
 
-            return h.getResult();
+            return new ResourceProxy(filePath, h.getResult());
         } catch (ParserConfigurationException e) {
             // TODO proper exception handling
             throw new RuntimeException(e);
@@ -94,9 +100,22 @@ public class SimpleXmlSerializationManag
         }
 
     }
+    
+    @Override
+    public SerializationDataBuilder newBuilder(Repository repository,
+    		File contentSyncRoot) throws SerializationException {
+    	return this;
+    }
 
     @Override
-    public String buildSerializationData(Map<String, Object> content) throws IOException {
+    public SerializationData buildSerializationData(File contentSyncRoot, ResourceProxy resource)
+            throws SerializationException {
+
+        if (resource == null) {
+            return null;
+        }
+
+        Map<String, Object> content = resource.getProperties();
 
         if (content == null || content.isEmpty()) {
             return null;
@@ -105,8 +124,8 @@ public class SimpleXmlSerializationManag
         try {
             SAXTransformerFactory f = (SAXTransformerFactory) SAXTransformerFactory.newInstance();
 
-            StringWriter sw = new StringWriter();
-            StreamResult sr = new StreamResult(sw);
+            ByteArrayOutputStream result = new ByteArrayOutputStream();
+            StreamResult sr = new StreamResult(result);
 
             TransformerHandler handler = f.newTransformerHandler();
             Transformer t = handler.getTransformer();
@@ -134,7 +153,8 @@ public class SimpleXmlSerializationManag
             endElement(handler, TAG_RESOURCE);
             handler.endDocument();
 
-            return sw.toString();
+            // TODO - also add the serialization type
+            return new SerializationData(resource.getPath(), CONTENT_XML, result.toByteArray(), null);
         } catch (TransformerConfigurationException e) {
             // TODO proper exception handling
             throw new RuntimeException(e);
@@ -157,6 +177,12 @@ public class SimpleXmlSerializationManag
         handler.endElement("", tagName, tagName);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.sling.ide.serialization.SerializationManager#destroy()
+     */
+    public void destroy() {
+    }
+
     static class SerializationDataHandler extends DefaultHandler {
         private Map<String, Object> result;
         private String propertyName;

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractCommand.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractCommand.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractCommand.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractCommand.java Mon Sep 30 10:28:08 2013
@@ -35,6 +35,7 @@ public abstract class AbstractCommand<T>
         this.path = createFullPath(relativePath);
     }
 
+    @Override
     public String getPath() {
         return path;
     }

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/AbstractRepository.java Mon Sep 30 10:28:08 2013
@@ -27,6 +27,10 @@ public abstract class AbstractRepository
 		this.repositoryInfo=repositoryInfo;
 	}
 
+    @Override
+    public RepositoryInfo getRepositoryInfo() {
+        return repositoryInfo;
+    }
 
 	@Override
 	public String toString() {

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/DeleteNodeCommand.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/DeleteNodeCommand.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/DeleteNodeCommand.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/DeleteNodeCommand.java Mon Sep 30 10:28:08 2013
@@ -23,18 +23,16 @@ import org.apache.commons.httpclient.met
 import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
 import org.apache.commons.httpclient.methods.multipart.Part;
 import org.apache.commons.httpclient.methods.multipart.StringPart;
-import org.apache.sling.ide.transport.FileInfo;
 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;
 
 class DeleteNodeCommand extends AbstractCommand<Void> {
 
-    private final FileInfo fileInfo;
 
-    DeleteNodeCommand(FileInfo fileInfo, RepositoryInfo repositoryInfo, HttpClient httpClient) {
-        super(repositoryInfo, httpClient, fileInfo.getRelativeLocation() + "/" + fileInfo.getName());
-        this.fileInfo = fileInfo;
+    DeleteNodeCommand(ResourceProxy resource, RepositoryInfo repositoryInfo, HttpClient httpClient) {
+        super(repositoryInfo, httpClient, resource.getPath());
     }
 
     @Override
@@ -57,6 +55,6 @@ class DeleteNodeCommand extends Abstract
 
     @Override
     public String toString() {
-    	return String.format("%8s %s", "DELETE", fileInfo.getRelativeLocation() + "/" + fileInfo.getName());
+    	return String.format("%8s %s", "DELETE", getPath());
     }
 }
\ No newline at end of file

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/GetNodeContentCommand.java Mon Sep 30 10:28:08 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/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/RepositoryImpl.java Mon Sep 30 10:28:08 2013
@@ -16,12 +16,11 @@
  */
 package org.apache.sling.ide.impl.resource.transport;
 
-import java.util.Map;
-
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.sling.ide.transport.Command;
 import org.apache.sling.ide.transport.FileInfo;
 import org.apache.sling.ide.transport.ResourceProxy;
+import org.apache.sling.ide.transport.TracingCommand;
 import org.osgi.service.event.EventAdmin;
 
 public class RepositoryImpl extends AbstractRepository{
@@ -29,19 +28,13 @@ public class RepositoryImpl extends Abst
     private final HttpClient httpClient = new HttpClient();
     private EventAdmin eventAdmin;
 
-	@Override
-	public Command<Void> newAddNodeCommand(final FileInfo fileInfo) {
-        return wrap(new AddNodeCommand(fileInfo, repositoryInfo, httpClient));
-	}
-
-
     private <T> Command<T> wrap(AbstractCommand<T> command) {
         return new TracingCommand<T>(command, eventAdmin);
     }
 
 	@Override
-	public Command<Void> newDeleteNodeCommand(final FileInfo fileInfo) {
-        return wrap(new DeleteNodeCommand(fileInfo, repositoryInfo, httpClient));
+	public Command<Void> newDeleteNodeCommand(final ResourceProxy resource) {
+        return wrap(new DeleteNodeCommand(resource, repositoryInfo, httpClient));
 	}
 	
 	@Override
@@ -56,14 +49,15 @@ 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"));
 	}
 	
 	@Override
-    public Command<Void> newUpdateContentNodeCommand(final FileInfo fileInfo, final Map<String, Object> properties) {
+    public Command<Void> newAddOrUpdateNodeCommand(final FileInfo fileInfo, ResourceProxy resource) {
 		
-        return wrap(new UpdateContentCommand(repositoryInfo, httpClient, fileInfo.getRelativeLocation(), properties, fileInfo));
+        return wrap(new UpdateContentCommand(repositoryInfo, httpClient, fileInfo.getRelativeLocation(),
+                resource.getProperties(), fileInfo));
 	}
 
     public void bindEventAdmin(EventAdmin eventAdmin) {

Modified: sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/UpdateContentCommand.java
URL: http://svn.apache.org/viewvc/sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/UpdateContentCommand.java?rev=1527508&r1=1527507&r2=1527508&view=diff
==============================================================================
--- sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/UpdateContentCommand.java (original)
+++ sling/trunk/tooling/ide/impl-resource/src/org/apache/sling/ide/impl/resource/transport/UpdateContentCommand.java Mon Sep 30 10:28:08 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.sling.ide.impl.resource.transport;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -24,6 +25,7 @@ import org.apache.commons.httpclient.Htt
 import org.apache.commons.httpclient.UsernamePasswordCredentials;
 import org.apache.commons.httpclient.auth.AuthScope;
 import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.httpclient.methods.multipart.FilePart;
 import org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity;
 import org.apache.commons.httpclient.methods.multipart.Part;
 import org.apache.commons.httpclient.methods.multipart.StringPart;
@@ -65,6 +67,10 @@ class UpdateContentCommand extends Abstr
                             + property.getValue().getClass());
                 }
     		}
+            File f = new File(fileInfo.getLocation());
+            if (f.isFile()) {
+                parts.add(new FilePart(fileInfo.getName(), f));
+            }
             post.setRequestEntity(new MultipartRequestEntity(parts.toArray(new Part[parts.size()]), post
                     .getParams()));
     		httpClient.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(repositoryInfo.getUsername(),repositoryInfo.getPassword()));

Propchange: sling/trunk/tooling/ide/impl-vlt/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 30 10:28:08 2013
@@ -0,0 +1,4 @@
+target
+.settings
+.classpath
+.project

Propchange: sling/trunk/tooling/ide/impl-vlt-test/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Sep 30 10:28:08 2013
@@ -0,0 +1,4 @@
+target
+.settings
+.classpath
+.project



Mime
View raw message