You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2009/05/08 22:32:44 UTC

svn commit: r773090 - in /incubator/chemistry/trunk/chemistry: chemistry-jcr/src/main/java/org/apache/chemistry/jcr/ chemistry-ws/

Author: fguillaume
Date: Fri May  8 20:32:44 2009
New Revision: 773090

URL: http://svn.apache.org/viewvc?rev=773090&view=rev
Log:
Adapt chemistry-jcr to updated Chemistry API

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewDocument.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewFolder.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrObjectEntry.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java
    incubator/chemistry/trunk/chemistry/chemistry-ws/   (props changed)

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java?rev=773090&r1=773089&r2=773090&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java Fri May  8 20:32:44 2009
@@ -40,6 +40,7 @@
 import org.apache.chemistry.Document;
 import org.apache.chemistry.Folder;
 import org.apache.chemistry.ObjectEntry;
+import org.apache.chemistry.ObjectId;
 import org.apache.chemistry.Policy;
 import org.apache.chemistry.Relationship;
 import org.apache.chemistry.RelationshipDirection;
@@ -48,6 +49,7 @@
 import org.apache.chemistry.SPI;
 import org.apache.chemistry.Unfiling;
 import org.apache.chemistry.VersioningState;
+import org.apache.chemistry.impl.simple.SimpleObjectId;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.JcrConstants;
@@ -64,24 +66,23 @@
         this.repository = repository;
     }
 
-    public void addObjectToFolder(ObjectEntry object, ObjectEntry folder) {
+    public void addObjectToFolder(CMISObject object, Folder folder) {
         throw new UnsupportedOperationException();
     }
 
-    public void applyPolicy(Policy policy, ObjectEntry object) {
+    public void applyPolicy(Policy policy, CMISObject object) {
         throw new UnsupportedOperationException();
     }
 
-    public void cancelCheckOut(ObjectEntry document) {
+    public void cancelCheckOut(Document document) {
         throw new UnsupportedOperationException();
     }
 
-    public CMISObject checkIn(ObjectEntry document, boolean major,
-                              String comment) {
+    public Document checkIn(Document document, boolean major, String comment) {
         throw new UnsupportedOperationException();
     }
 
-    public CMISObject checkOut(ObjectEntry document) {
+    public Document checkOut(Document document) {
         throw new UnsupportedOperationException();
     }
 
@@ -89,42 +90,36 @@
         session.logout();
     }
 
-    public void deleteAllVersions(ObjectEntry document) {
+    public void deleteAllVersions(Document document) {
         throw new UnsupportedOperationException();
     }
 
-    public void deleteObject(ObjectEntry object) {
+    public void deleteObject(CMISObject object) {
         throw new UnsupportedOperationException();
     }
 
-    public Collection<String> deleteTree(ObjectEntry folder, Unfiling unfiling,
-                                         boolean continueOnFailure) {
+    public Collection<String> deleteTree(Folder folder, Unfiling unfiling,
+            boolean continueOnFailure) {
         JcrFolder f = (JcrFolder) folder;
         f.delete();
         return Collections.emptySet();
     }
 
-    public Collection<ObjectEntry> getAllVersions(ObjectEntry document,
-                                                  String filter) {
+    public Collection<Document> getAllVersions(Document document, String filter) {
         throw new UnsupportedOperationException();
     }
 
-    public Collection<Policy> getAppliedPolicies(ObjectEntry object) {
+    public Collection<Policy> getAppliedPolicies(CMISObject object) {
         throw new UnsupportedOperationException();
     }
 
-    public List<ObjectEntry> getChildren(ObjectEntry folder) {
-        return getChildren(folder.getId(), null, null, false, false,
-                Integer.MAX_VALUE, 0, null, new boolean[1]);
-    }
-
-    public CMISObject getLatestVersion(ObjectEntry document, boolean major) {
+    public Document getLatestVersion(Document document, boolean major) {
         throw new UnsupportedOperationException();
     }
 
-    public CMISObject getObject(String objectId, ReturnVersion returnVersion) {
+    public CMISObject getObject(ObjectId objectId, ReturnVersion returnVersion) {
         try {
-            String relPath = JcrObjectEntry.getPath(objectId).substring(1);
+            String relPath = JcrObjectEntry.getPath(objectId.getId()).substring(1);
             if (relPath.equals("")) {
                 return getRootFolder();
             } else {
@@ -142,10 +137,9 @@
         return null;
     }
 
-    public List<ObjectEntry> getRelationships(ObjectEntry object,
-                                              RelationshipDirection direction,
-                                              String typeId,
-                                              boolean includeSubRelationshipTypes) {
+    public List<Relationship> getRelationships(CMISObject object,
+            RelationshipDirection direction, String typeId,
+            boolean includeSubRelationshipTypes) {
         throw new UnsupportedOperationException();
     }
 
@@ -153,10 +147,6 @@
         return repository;
     }
 
-    public ObjectEntry getRootEntry() {
-        return getRootFolder();
-    }
-
     public Folder getRootFolder() {
         try {
             return new JcrFolder(session.getRootNode());
@@ -171,20 +161,20 @@
         return this;
     }
 
-    public void moveObject(ObjectEntry object, ObjectEntry targetFolder,
-                           ObjectEntry sourceFolder) {
+    public void moveObject(CMISObject object, Folder targetFolder,
+            Folder sourceFolder) {
         throw new UnsupportedOperationException();
     }
 
-    public Document newDocument(String typeId, ObjectEntry folder) {
+    public Document newDocument(String typeId, Folder folder) {
         throw new UnsupportedOperationException();
     }
 
-    public Folder newFolder(String typeId, ObjectEntry folder) {
+    public Folder newFolder(String typeId, Folder folder) {
         throw new UnsupportedOperationException();
     }
 
-    public Policy newPolicy(String typeId, ObjectEntry folder) {
+    public Policy newPolicy(String typeId, Folder folder) {
         throw new UnsupportedOperationException();
     }
 
@@ -192,50 +182,65 @@
         throw new UnsupportedOperationException();
     }
 
-    public Collection<ObjectEntry> query(String statement,
-                                         boolean searchAllVersions) {
-
+    public Collection<CMISObject> query(String statement,
+            boolean searchAllVersions) {
         boolean[] hasMoreItems = new boolean[1];
-        return query(statement, searchAllVersions, false, false,
-                Integer.MAX_VALUE, 0, hasMoreItems);
+        Collection<ObjectEntry> entries = query(statement, searchAllVersions,
+                false, false, Integer.MAX_VALUE, 0, hasMoreItems);
+        List<CMISObject> objects = new ArrayList<CMISObject>(entries.size());
+        for (ObjectEntry entry : entries) {
+            // cast entries, they are all JcrFolder or JcrDocument
+            objects.add((CMISObject) entry);
+        }
+        return objects;
     }
 
-    public void removeObjectFromFolder(ObjectEntry object, ObjectEntry folder) {
+    public ObjectEntry newObjectEntry(String typeId) {
+        // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
 
-    public void removePolicy(Policy policy, ObjectEntry object) {
+    public ObjectId newObjectId(String id) {
+        // TODO Auto-generated method stub
+        throw new UnsupportedOperationException();
+    }
+
+    public void removeObjectFromFolder(CMISObject object, Folder folder) {
+        throw new UnsupportedOperationException();
+    }
+
+    public void removePolicy(Policy policy, CMISObject object) {
         throw new UnsupportedOperationException();
     }
 
     //---------------------------------------------------------------------- SPI
 
-    public void addObjectToFolder(String objectId, String folderId) {
+    public void addObjectToFolder(ObjectId objectId, ObjectId folderId) {
         throw new UnsupportedOperationException();
     }
 
-    public void applyPolicy(String policyId, String objectId) {
+    public void applyPolicy(ObjectId policyId, ObjectId objectId) {
         throw new UnsupportedOperationException();
     }
 
-    public void cancelCheckOut(String documentId) {
+    public void cancelCheckOut(ObjectId documentId) {
         throw new UnsupportedOperationException();
     }
 
-    public String checkIn(String documentId, boolean major,
+    public ObjectId checkIn(ObjectId documentId, boolean major,
                           Map<String, Serializable> properties,
                           ContentStream contentStream, String comment) {
         throw new UnsupportedOperationException();
     }
 
-    public String checkOut(String documentId, boolean[] contentCopied) {
+    public ObjectId checkOut(ObjectId documentId, boolean[] contentCopied) {
         throw new UnsupportedOperationException();
     }
 
     // TODO add IOException to throws clause
-    public String createDocument(String typeId,
+    public ObjectId createDocument(String typeId,
                                  Map<String, Serializable> properties,
-                                 String folderId, ContentStream contentStream,
+                                 ObjectId folderId, ContentStream contentStream,
                                  VersioningState versioningState) {
 
         try {
@@ -249,7 +254,7 @@
                 doc.setContentStream(contentStream);
             }
             doc.save();
-            return doc.getId();
+            return new SimpleObjectId(doc.getId());
         } catch (IOException e) {
             String msg = "Unable to create document.";
             log.error(msg, e);
@@ -257,21 +262,21 @@
         return null;
     }
 
-    public String createFolder(String typeId,
+    public ObjectId createFolder(String typeId,
                                Map<String, Serializable> properties,
-                               String folderId) {
+                               ObjectId folderId) {
         throw new UnsupportedOperationException();
     }
 
-    public String createPolicy(String typeId,
+    public ObjectId createPolicy(String typeId,
                                Map<String, Serializable> properties,
-                               String folderId) {
+                               ObjectId folderId) {
         throw new UnsupportedOperationException();
     }
 
-    public String createRelationship(String typeId,
+    public ObjectId createRelationship(String typeId,
                                      Map<String, Serializable> properties,
-                                     String sourceId, String targetId) {
+                                     ObjectId sourceId, ObjectId targetId) {
         throw new UnsupportedOperationException();
     }
 
@@ -279,15 +284,15 @@
         throw new UnsupportedOperationException();
     }
 
-    public void deleteContentStream(String documentId) {
+    public void deleteContentStream(ObjectId documentId) {
         throw new UnsupportedOperationException();
     }
 
-    public void deleteObject(String objectId) {
+    public void deleteObject(ObjectId objectId) {
         throw new UnsupportedOperationException();
     }
 
-    public Collection<String> deleteTree(String folderId, Unfiling unfiling,
+    public Collection<String> deleteTree(ObjectId folderId, Unfiling unfiling,
                                          boolean continueOnFailure) {
         throw new UnsupportedOperationException();
     }
@@ -297,16 +302,16 @@
         throw new UnsupportedOperationException();
     }
 
-    public Collection<String> getAllowableActions(String objectId, String asUser) {
+    public Collection<String> getAllowableActions(ObjectId objectId, String asUser) {
         throw new UnsupportedOperationException();
     }
 
-    public Collection<ObjectEntry> getAppliedPolicies(String objectId,
+    public Collection<ObjectEntry> getAppliedPolicies(ObjectId objectId,
                                                       String filter) {
         throw new UnsupportedOperationException();
     }
 
-    public Collection<ObjectEntry> getCheckedoutDocuments(String folderId,
+    public Collection<ObjectEntry> getCheckedoutDocuments(ObjectId folderId,
                                                           String filter,
                                                           boolean includeAllowableActions,
                                                           boolean includeRelationships,
@@ -316,7 +321,7 @@
         throw new UnsupportedOperationException();
     }
 
-    public List<ObjectEntry> getChildren(String folderId, BaseType type,
+    public List<ObjectEntry> getChildren(ObjectId folderId, BaseType type,
                                          String filter,
                                          boolean includeAllowableActions,
                                          boolean includeRelationships,
@@ -329,7 +334,7 @@
             }
 
             Node node = session.getRootNode();
-            String relPath = JcrObjectEntry.getPath(folderId).substring(1);
+            String relPath = JcrObjectEntry.getPath(folderId.getId()).substring(1);
             if (!relPath.equals("")) {
                 node = node.getNode(relPath);
             }
@@ -367,11 +372,11 @@
         return this;
     }
 
-    public InputStream getContentStream(String documentId, int offset,
+    public InputStream getContentStream(ObjectId documentId, int offset,
                                         int length) throws IOException {
 
         try {
-            String relPath = JcrObjectEntry.getPath(documentId).substring(1);
+            String relPath = JcrObjectEntry.getPath(documentId.getId()).substring(1);
             Node node = session.getRootNode().getNode(relPath);
             JcrDocument document = new JcrDocument(node);
             return document.getStream();
@@ -382,7 +387,7 @@
         return null;
     }
 
-    public List<ObjectEntry> getDescendants(String folderId, BaseType type,
+    public List<ObjectEntry> getDescendants(ObjectId folderId, BaseType type,
                                             int depth, String filter,
                                             boolean includeAllowableActions,
                                             boolean includeRelationships,
@@ -391,7 +396,7 @@
         return null;
     }
 
-    public List<ObjectEntry> getFolderParent(String folderId, String filter,
+    public List<ObjectEntry> getFolderParent(ObjectId folderId, String filter,
                                              boolean includeAllowableActions,
                                              boolean includeRelationships,
                                              boolean returnToRoot) {
@@ -399,7 +404,7 @@
         return null;
     }
 
-    public Collection<ObjectEntry> getObjectParents(String objectId,
+    public Collection<ObjectEntry> getObjectParents(ObjectId objectId,
                                                     String filter,
                                                     boolean includeAllowableActions,
                                                     boolean includeRelationships) {
@@ -407,16 +412,16 @@
         return null;
     }
 
-    public ObjectEntry getProperties(String objectId,
+    public ObjectEntry getProperties(ObjectId objectId,
                                      ReturnVersion returnVersion,
                                      String filter,
                                      boolean includeAllowableActions,
                                      boolean includeRelationships) {
 
         try {
-            String relPath = JcrObjectEntry.getPath(objectId).substring(1);
+            String relPath = JcrObjectEntry.getPath(objectId.getId()).substring(1);
             if (relPath.equals("")) {
-                return getRootFolder();
+                return (ObjectEntry) getRootFolder();
             } else {
                 Node node = session.getRootNode().getNode(relPath);
                 if (node.isNodeType(JcrConstants.NT_FOLDER)) {
@@ -439,7 +444,7 @@
         return null;
     }
 
-    public List<ObjectEntry> getRelationships(String objectId,
+    public List<ObjectEntry> getRelationships(ObjectId objectId,
                                               RelationshipDirection direction,
                                               String typeId,
                                               boolean includeSubRelationshipTypes,
@@ -451,8 +456,13 @@
         return Collections.emptyList();
     }
 
-    public void moveObject(String objectId, String targetFolderId,
-                           String sourceFolderId) {
+    public boolean hasContentStream(ObjectId document) {
+        // TODO Auto-generated method stub
+        throw new UnsupportedOperationException();
+    }
+
+    public void moveObject(ObjectId objectId, ObjectId targetFolderId,
+            ObjectId sourceFolderId) {
 
         throw new UnsupportedOperationException();
     }
@@ -491,21 +501,22 @@
         return null;
     }
 
-    public void removeObjectFromFolder(String objectId, String folderId) {
+    public void removeObjectFromFolder(ObjectId objectId, ObjectId folderId) {
         throw new UnsupportedOperationException();
     }
 
-    public void removePolicy(String policyId, String objectId) {
+    public void removePolicy(ObjectId policyId, ObjectId objectId) {
         throw new UnsupportedOperationException();
     }
 
-    public void setContentStream(String documentId, boolean overwrite,
+    public ObjectId setContentStream(ObjectId documentId, boolean overwrite,
                                  ContentStream contentStream) {
         throw new UnsupportedOperationException();
     }
 
-    public String updateProperties(String objectId, String changeToken,
+    public ObjectId updateProperties(ObjectId objectId, String changeToken,
                                    Map<String, Serializable> properties) {
         throw new UnsupportedOperationException();
     }
+
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java?rev=773090&r1=773089&r2=773090&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java Fri May  8 20:32:44 2009
@@ -26,9 +26,9 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.chemistry.BaseType;
+import org.apache.chemistry.CMISObject;
 import org.apache.chemistry.Document;
 import org.apache.chemistry.Folder;
-import org.apache.chemistry.ObjectEntry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.JcrConstants;
@@ -43,14 +43,14 @@
 
     protected JcrFolder() {}
 
-    public List<ObjectEntry> getChildren(BaseType type, String orderBy) {
+    public List<CMISObject> getChildren(BaseType type, String orderBy) {
         try {
-            List<ObjectEntry> result = new ArrayList<ObjectEntry>();
+            List<CMISObject> result = new ArrayList<CMISObject>();
 
             NodeIterator iter = node.getNodes();
             while (iter.hasNext()) {
                 Node child = iter.nextNode();
-                JcrObjectEntry entry = null;
+                CMISObject entry = null;
                 if (child.isNodeType(JcrConstants.NT_FOLDER)) {
                     entry = new JcrFolder(child);
                 } else if (child.isNodeType(JcrConstants.NT_FILE)) {

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewDocument.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewDocument.java?rev=773090&r1=773089&r2=773090&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewDocument.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewDocument.java Fri May  8 20:32:44 2009
@@ -47,6 +47,7 @@
         this.parent = parent;
     }
 
+    @Override
     public ContentStream getContentStream() {
         if (!saved) {
             throw new UnsupportedOperationException();
@@ -54,6 +55,7 @@
         return super.getContentStream();
     }
 
+    @Override
     public Folder getParent() {
         if (!saved) {
             return new JcrFolder(parent);
@@ -61,6 +63,7 @@
         return super.getParent();
     }
 
+    @Override
     public InputStream getStream() throws IOException {
         if (!saved) {
             throw new UnsupportedOperationException();
@@ -68,6 +71,7 @@
         return super.getStream();
     }
 
+    @Override
     public void setContentStream(ContentStream contentStream)
             throws IOException {
 
@@ -77,6 +81,7 @@
         this.cs = contentStream;
     }
 
+    @Override
     public void save() {
         if (saved) {
             throw new UnsupportedOperationException();
@@ -87,13 +92,13 @@
                 name = cs.getFilename();
             }
             if (name == null) {
-            	Serializable val = getValue("title");
-            	if (val != null) {
+                Serializable val = getValue("title");
+                if (val != null) {
                     name = val.toString();
                 }
             }
             if (name == null) {
-            	name = "unnamed";
+                name = "unnamed";
             }
 
             Node node = parent.addNode(name, JcrConstants.NT_FILE);
@@ -124,6 +129,7 @@
         }
     }
 
+    @Override
     public void setName(String name) {
         if (saved) {
             throw new UnsupportedOperationException();
@@ -131,6 +137,7 @@
         this.name = name;
     }
 
+    @Override
     public void setValue(String name, Serializable value) {
         if (saved) {
             throw new UnsupportedOperationException();
@@ -138,6 +145,7 @@
         values.put(name, value);
     }
 
+    @Override
     public void setValues(Map<String, Serializable> values) {
         if (saved) {
             throw new UnsupportedOperationException();

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewFolder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewFolder.java?rev=773090&r1=773089&r2=773090&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewFolder.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrNewFolder.java Fri May  8 20:32:44 2009
@@ -25,9 +25,9 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.chemistry.BaseType;
+import org.apache.chemistry.CMISObject;
 import org.apache.chemistry.Document;
 import org.apache.chemistry.Folder;
-import org.apache.chemistry.ObjectEntry;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.JcrConstants;
@@ -45,13 +45,15 @@
         this.parent = parent;
     }
 
-    public List<ObjectEntry> getChildren(BaseType type, String orderBy) {
+    @Override
+    public List<CMISObject> getChildren(BaseType type, String orderBy) {
         if (!saved) {
             throw new UnsupportedOperationException();
         }
         return super.getChildren(type, orderBy);
     }
 
+    @Override
     public Document newDocument(String typeId) {
         if (!saved) {
             throw new UnsupportedOperationException();
@@ -59,6 +61,7 @@
         return super.newDocument(typeId);
     }
 
+    @Override
     public Folder newFolder(String typeId) {
         if (!saved) {
             throw new UnsupportedOperationException();
@@ -66,6 +69,7 @@
         return super.newFolder(typeId);
     }
 
+    @Override
     public Folder getParent() {
         if (!saved) {
             return new JcrFolder(parent);
@@ -73,6 +77,7 @@
         return super.getParent();
     }
 
+    @Override
     public void save() {
         if (saved) {
             throw new UnsupportedOperationException();
@@ -93,6 +98,7 @@
         }
     }
 
+    @Override
     public void setName(String name) {
         if (saved) {
             throw new UnsupportedOperationException();
@@ -100,6 +106,7 @@
         this.name = name;
     }
 
+    @Override
     public void setValue(String name, Serializable value) {
         if (saved) {
             throw new UnsupportedOperationException();
@@ -107,6 +114,7 @@
         values.put(name, value);
     }
 
+    @Override
     public void setValues(Map<String, Serializable> values) {
         if (saved) {
             throw new UnsupportedOperationException();

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrObjectEntry.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrObjectEntry.java?rev=773090&r1=773089&r2=773090&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrObjectEntry.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrObjectEntry.java Fri May  8 20:32:44 2009
@@ -383,6 +383,15 @@
         return null;
     }
 
+    public Map<String, Serializable> getValues() {
+        Map<String, Serializable> values = new HashMap<String, Serializable>();
+        for (PropertyDefinition def : getType().getPropertyDefinitions()) {
+            String name = def.getName();
+            values.put(name, getValue(name));
+        }
+        return values;
+    }
+
     public String getVersionLabel() {
         // TODO Auto-generated method stub
         return null;

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java?rev=773090&r1=773089&r2=773090&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrRepository.java Fri May  8 20:32:44 2009
@@ -33,12 +33,15 @@
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.Connection;
 import org.apache.chemistry.JoinCapability;
+import org.apache.chemistry.ObjectId;
 import org.apache.chemistry.QueryCapability;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.RepositoryCapabilities;
 import org.apache.chemistry.RepositoryEntry;
 import org.apache.chemistry.RepositoryInfo;
+import org.apache.chemistry.SPI;
 import org.apache.chemistry.Type;
+import org.apache.chemistry.impl.simple.SimpleObjectId;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jackrabbit.JcrConstants;
@@ -60,6 +63,11 @@
         this(repository, null);
     }
 
+    public SPI getSPI() {
+        // TODO parameters
+        return (SPI) getConnection(null);
+    }
+
     public Connection getConnection(Map<String, Serializable> parameters) {
         // TODO pass credentials as parameters
         SimpleCredentials creds = new SimpleCredentials("admin", "admin".toCharArray());
@@ -184,8 +192,8 @@
         return null;
     }
 
-    public String getRootFolderId() {
-        return JcrObjectEntry.escape("/");
+    public ObjectId getRootFolderId() {
+        return new SimpleObjectId(JcrObjectEntry.escape("/"));
     }
 
     public String getVendorName() {

Propchange: incubator/chemistry/trunk/chemistry/chemistry-ws/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri May  8 20:32:44 2009
@@ -0,0 +1,6 @@
+bin
+target
+*.iws
+*.ipr
+*.iml
+.*