chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r800672 [2/3] - in /incubator/chemistry/trunk/chemistry: chemistry-api/src/main/java/org/apache/chemistry/ chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/ chemistry-atompub-client/src/main/java/org/apache/chemist...
Date Tue, 04 Aug 2009 04:26:34 GMT
Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeEntryReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeEntryReader.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeEntryReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeEntryReader.java Tue Aug  4 04:26:32 2009
@@ -25,9 +25,9 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.PropertyDefinition;
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
 import org.apache.chemistry.atompub.client.stax.AbstractEntryReader;
 import org.apache.chemistry.atompub.client.stax.ReadContext;
 import org.apache.chemistry.xml.stax.ChildrenNavigator;
@@ -55,8 +55,8 @@
             APPType object) throws XMLStreamException {
         // read only links - optimization to avoid useless operations
         if ("link".equals(reader.getLocalName())) {
-            String rel = reader.getAttributeValue(Atom.ATOM_NS, "rel");
-            String href = reader.getAttributeValue(Atom.ATOM_NS, "href");
+            String rel = reader.getAttributeValue(AtomPub.ATOM_NS, "rel");
+            String href = reader.getAttributeValue(AtomPub.ATOM_NS, "href");
             object.addLink(rel, href);
         }
     }
@@ -67,7 +67,8 @@
         String localName = reader.getLocalName();
         if (CMIS.DOCUMENT_TYPE.getLocalPart().equals(localName)
                 || CMIS.FOLDER_TYPE.getLocalPart().equals(localName)
-                || CMIS.RELATIONSHIP_TYPE.getLocalPart().equals(localName)
+                || CMIS.RELATIONSHIP_TYPE.getLocalPart().equals(
+                        localName)
                 || CMIS.POLICY_TYPE.getLocalPart().equals(localName)) {
             ChildrenNavigator children = reader.getChildren();
             Map<String, String> map = new HashMap<String, String>();

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractEntryReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractEntryReader.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractEntryReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractEntryReader.java Tue Aug  4 04:26:32 2009
@@ -21,8 +21,9 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.xml.stax.ChildrenNavigator;
 import org.apache.chemistry.xml.stax.StaxReader;
 
@@ -43,7 +44,7 @@
     }
 
     public T read(ReadContext ctx, StaxReader reader) throws XMLStreamException {
-        if (!reader.getFirstTag(Atom.ATOM_ENTRY)) {
+        if (!reader.getFirstTag(AtomPub.ATOM_ENTRY)) {
             return null;
         }
         T object = createObject(ctx);
@@ -51,7 +52,7 @@
         while (children.next()) {
             String nsuri = reader.getNamespaceURI();
             if (nsuri.equals(CMIS.CMIS_NS)
-                    || nsuri.equals(CMIS.CMISRA_NS)) {
+                    || nsuri.equals(AtomPubCMIS.CMISRA_NS)) {
                 readCmisElement(ctx, reader, object);
             } else {
                 readEntryElement(ctx, reader, object);
@@ -67,7 +68,7 @@
 
     protected void readEntryElement(ReadContext ctx, StaxReader reader, T object)
             throws XMLStreamException {
-        if (reader.getNamespaceURI().equals(Atom.ATOM_NS)) {
+        if (reader.getNamespaceURI().equals(AtomPub.ATOM_NS)) {
             readAtomElement(ctx, reader, object);
         } else {
             readExtensionElement(ctx, reader, object);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractFeedReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractFeedReader.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractFeedReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractFeedReader.java Tue Aug  4 04:26:32 2009
@@ -25,7 +25,7 @@
 
 import javax.xml.stream.XMLStreamException;
 
-import org.apache.chemistry.atompub.Atom;
+import org.apache.chemistry.atompub.AtomPub;
 import org.apache.chemistry.xml.stax.ChildrenNavigator;
 import org.apache.chemistry.xml.stax.StaxReader;
 
@@ -91,7 +91,7 @@
     }
 
     public T read(ReadContext ctx, StaxReader reader) throws XMLStreamException {
-        if (!reader.getFirstTag(Atom.ATOM_FEED)) {
+        if (!reader.getFirstTag(AtomPub.ATOM_FEED)) {
             throw new XMLStreamException("Parse error: Not an atom feed");
         }
         // create a new feed object to be filled
@@ -99,7 +99,7 @@
         ChildrenNavigator nav = reader.getChildren();
         while (nav.next() && !isDone(ctx, reader)) {
             String nsUri = reader.getNamespaceURI();
-            if (Atom.ATOM_NS.equals(nsUri)) {
+            if (AtomPub.ATOM_NS.equals(nsUri)) {
                 if ("entry".equals(reader.getLocalName())) {
                     addEntry(feed, entryBuilder.read(ctx, reader));
                 } else {

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractObjectReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractObjectReader.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractObjectReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/AbstractObjectReader.java Tue Aug  4 04:26:32 2009
@@ -19,14 +19,18 @@
 package org.apache.chemistry.atompub.client.stax;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.Property;
 import org.apache.chemistry.PropertyDefinition;
 import org.apache.chemistry.Type;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.xml.stax.ChildrenNavigator;
 import org.apache.chemistry.xml.stax.ParseException;
 import org.apache.chemistry.xml.stax.StaxReader;
@@ -39,10 +43,13 @@
     protected abstract void readProperty(ReadContext ctx, StaxReader reader,
             T object, XmlProperty p);
 
+    protected abstract void readAllowableActions(ReadContext ctx,
+            StaxReader reader, T object, Map<QName, Boolean> allowableActions);
+
     @Override
     protected void readCmisElement(ReadContext ctx, StaxReader reader, T object)
             throws XMLStreamException {
-        if (reader.getLocalName().equals(CMIS.RESTATOM_OBJECT.getLocalPart())) {
+        if (reader.getLocalName().equals(AtomPubCMIS.OBJECT.getLocalPart())) {
             readCmisObject(ctx, reader, object);
         }
     }
@@ -133,7 +140,14 @@
 
     protected void readAllowableActions(ReadContext ctx, StaxReader reader,
             T object) throws XMLStreamException {
-        // TODO not yet implemented
+        Map<QName, Boolean> allowableActions = new HashMap<QName, Boolean>();
+        ChildrenNavigator children = reader.getChildren();
+        while (children.next()) {
+            QName qname = reader.getName();
+            Boolean bool = Boolean.valueOf(reader.getElementText());
+            allowableActions.put(qname, bool);
+        }
+        readAllowableActions(ctx, reader, object, allowableActions);
     }
 
     protected void readChangeEventInfo(ReadContext ctx, StaxReader reader,

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ObjectEntryWriter.java Tue Aug  4 04:26:32 2009
@@ -19,10 +19,11 @@
 import java.io.IOException;
 import java.util.Date;
 
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.ObjectEntry;
 import org.apache.chemistry.Property;
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.xml.stax.XMLWriter;
 
 /**
@@ -33,7 +34,7 @@
 
     @Override
     public String getContentType() {
-        return Atom.MEDIA_TYPE_ATOM_ENTRY;
+        return AtomPub.MEDIA_TYPE_ATOM_ENTRY;
     }
 
     @Override
@@ -41,9 +42,9 @@
         try {
             xw.start();
             xw.element("entry");
-            xw.xmlns(Atom.ATOM_NS);
+            xw.xmlns(AtomPub.ATOM_NS);
             xw.xmlns(CMIS.CMIS_PREFIX, CMIS.CMIS_NS);
-            xw.xmlns(CMIS.CMISRA_PREFIX, CMIS.CMISRA_NS);
+            xw.xmlns(AtomPubCMIS.CMISRA_PREFIX, AtomPubCMIS.CMISRA_NS);
             xw.start();
             // atom requires an ID to be set even on new created entries ..
             xw.element("id").content("urn:uuid:" + object.getId());

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/PropertyIterator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/PropertyIterator.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/PropertyIterator.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/PropertyIterator.java Tue Aug  4 04:26:32 2009
@@ -21,7 +21,7 @@
 
 import javax.xml.stream.XMLStreamException;
 
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.xml.stax.ChildrenIterator;
 import org.apache.chemistry.xml.stax.StaxReader;
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/QueryWriter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/QueryWriter.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/QueryWriter.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/QueryWriter.java Tue Aug  4 04:26:32 2009
@@ -19,7 +19,8 @@
 
 import java.io.IOException;
 
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.xml.stax.XMLWriter;
 
 /**
@@ -67,7 +68,7 @@
 
     @Override
     public String getContentType() {
-        return CMIS.MEDIA_TYPE_CMIS_QUERY;
+        return AtomPubCMIS.MEDIA_TYPE_CMIS_QUERY;
     }
 
     @Override

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ServiceDocumentReader.java Tue Aug  4 04:26:32 2009
@@ -28,16 +28,17 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 
-import org.apache.chemistry.ACLCapability;
+import org.apache.chemistry.CapabilityACL;
 import org.apache.chemistry.BaseType;
-import org.apache.chemistry.ChangeCapability;
-import org.apache.chemistry.JoinCapability;
-import org.apache.chemistry.QueryCapability;
-import org.apache.chemistry.RenditionCapability;
+import org.apache.chemistry.CMIS;
+import org.apache.chemistry.CapabilityChange;
+import org.apache.chemistry.CapabilityJoin;
+import org.apache.chemistry.CapabilityQuery;
+import org.apache.chemistry.CapabilityRendition;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.RepositoryInfo;
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.URITemplate;
 import org.apache.chemistry.atompub.client.APPRepository;
 import org.apache.chemistry.atompub.client.APPRepositoryCapabilities;
@@ -72,15 +73,15 @@
                 ChildrenNavigator children = reader.getChildren();
                 while (children.next()) {
                     QName name = reader.getName();
-                    if (name.equals(Atom.APP_COLLECTION)) {
+                    if (name.equals(AtomPub.APP_COLLECTION)) {
                         String href = reader.getAttributeValue("href");
-                        String type = reader.getAttributeValue(CMIS.RESTATOM_COLLECTION_TYPE.getLocalPart());
+                        String type = reader.getAttributeValue(AtomPubCMIS.COLLECTION_TYPE.getLocalPart());
                         addCollection(repo, href, type);
-                    } else if (name.equals(CMIS.RESTATOM_REPOSITORY_INFO)) {
+                    } else if (name.equals(AtomPubCMIS.REPOSITORY_INFO)) {
                         RepositoryInfo info = readRepositoryInfo(context,
                                 reader);
                         setInfo(repo, info);
-                    } else if (name.equals(CMIS.RESTATOM_URI_TEMPLATE)) {
+                    } else if (name.equals(AtomPubCMIS.URI_TEMPLATE)) {
                         URITemplate uriTemplate = readURITemplate(context,
                                 reader);
                         addURITemplate(repo, uriTemplate);
@@ -126,23 +127,23 @@
                     } else if (localName.equals(CMIS.CAPABILITY_VERSION_SPECIFIC_FILING.getLocalPart())) {
                         caps.setHasVersionSpecificFiling(Boolean.parseBoolean(reader.getElementText()));
                     } else if (localName.equals(CMIS.CAPABILITY_QUERY.getLocalPart())) {
-                        caps.setQueryCapability(QueryCapability.get(
-                                reader.getElementText(), QueryCapability.NONE));
+                        caps.setQueryCapability(CapabilityQuery.get(
+                                reader.getElementText(), CapabilityQuery.NONE));
                     } else if (localName.equals(CMIS.CAPABILITY_JOIN.getLocalPart())) {
-                        caps.setJoinCapability(JoinCapability.get(
-                                reader.getElementText(), JoinCapability.NONE));
+                        caps.setJoinCapability(CapabilityJoin.get(
+                                reader.getElementText(), CapabilityJoin.NONE));
                     } else if (localName.equals(CMIS.CAPABILITY_RENDITIONS.getLocalPart())) {
-                        caps.setRenditionCapability(RenditionCapability.get(
+                        caps.setRenditionCapability(CapabilityRendition.get(
                                 reader.getElementText(),
-                                RenditionCapability.NONE));
+                                CapabilityRendition.NONE));
                     } else if (localName.equals(CMIS.CAPABILITY_CHANGES.getLocalPart())) {
-                        caps.setChangeCapability(ChangeCapability.get(
-                                reader.getElementText(), ChangeCapability.NONE));
+                        caps.setChangeCapability(CapabilityChange.get(
+                                reader.getElementText(), CapabilityChange.NONE));
                     } else if (localName.equals(CMIS.CAPABILITY_CHANGES_ON_TYPE.getLocalPart())) {
                         changeLogBaseTypes.add(BaseType.get(reader.getElementText()));
                     } else if (localName.equals(CMIS.CAPABILITY_ACL.getLocalPart())) {
-                        caps.setACLCapability(ACLCapability.get(
-                                reader.getElementText(), ACLCapability.NONE));
+                        caps.setACLCapability(CapabilityACL.get(
+                                reader.getElementText(), CapabilityACL.NONE));
                     }
                 }
             } else if (localName.equals(CMIS.REPOSITORY_SPECIFIC_INFORMATION.getLocalPart())) {
@@ -151,6 +152,13 @@
                 map.put(localName, reader.getElementText());
             }
         }
+        if (changeLogBaseTypes.isEmpty()) {
+            // TODO-0.63 TCK checks 0.62 schema which has minOccurs=1
+            changeLogBaseTypes.add(BaseType.DOCUMENT);
+            changeLogBaseTypes.add(BaseType.FOLDER);
+            changeLogBaseTypes.add(BaseType.RELATIONSHIP);
+            changeLogBaseTypes.add(BaseType.POLICY);
+        }
         return new APPRepositoryInfo(caps, map, changeLogBaseTypes);
     }
 
@@ -162,11 +170,11 @@
         ChildrenNavigator nav = reader.getChildren();
         while (nav.next()) {
             String localName = reader.getLocalName();
-            if (localName.equals(CMIS.RESTATOM_TYPE.getLocalPart())) {
+            if (localName.equals(AtomPubCMIS.TYPE.getLocalPart())) {
                 type = reader.getElementText();
-            } else if (localName.equals(CMIS.RESTATOM_MEDIA_TYPE.getLocalPart())) {
+            } else if (localName.equals(AtomPubCMIS.MEDIA_TYPE.getLocalPart())) {
                 mediaType = reader.getElementText();
-            } else if (localName.equals(CMIS.RESTATOM_TEMPLATE.getLocalPart())) {
+            } else if (localName.equals(AtomPubCMIS.TEMPLATE.getLocalPart())) {
                 template = reader.getElementText();
             }
         }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ValueIterator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ValueIterator.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ValueIterator.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/stax/ValueIterator.java Tue Aug  4 04:26:32 2009
@@ -18,7 +18,7 @@
 
 import javax.xml.stream.XMLStreamException;
 
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.xml.stax.ChildrenIterator;
 import org.apache.chemistry.xml.stax.StaxReader;
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/stax/TestPropertyIterator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/stax/TestPropertyIterator.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/stax/TestPropertyIterator.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/stax/TestPropertyIterator.java Tue Aug  4 04:26:32 2009
@@ -24,7 +24,7 @@
 
 import junit.framework.TestCase;
 
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.xml.stax.StaxReader;
 
 /**

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java Tue Aug  4 04:26:32 2009
@@ -45,6 +45,7 @@
 import org.apache.abdera.protocol.server.context.ResponseContextException;
 import org.apache.abdera.util.EntityTag;
 import org.apache.chemistry.BaseType;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.ContentStream;
 import org.apache.chemistry.ObjectEntry;
 import org.apache.chemistry.ObjectId;
@@ -54,8 +55,8 @@
 import org.apache.chemistry.SPI;
 import org.apache.chemistry.Type;
 import org.apache.chemistry.VersioningState;
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.abdera.ObjectElement;
 import org.apache.chemistry.impl.simple.SimpleObjectId;
 import org.apache.chemistry.util.GregorianCalendar;
@@ -85,7 +86,7 @@
         feed.setUpdated(new Date()); // XXX
 
         feed.addLink(getChildrenLink(id, request), "self");
-        feed.addLink(getObjectLink(id, request), CMIS.LINK_SOURCE);
+        feed.addLink(getObjectLink(id, request), AtomPubCMIS.LINK_SOURCE);
 
         // RFC 5005 paging
 
@@ -158,17 +159,17 @@
         if (baseType == BaseType.FOLDER) {
             String pid = (String) object.getValue(Property.PARENT_ID);
             if (pid != null) {
-                entry.addLink(getObjectLink(pid, request), Atom.LINK_UP,
-                        Atom.MEDIA_TYPE_ATOM_ENTRY, null, null, -1);
+                entry.addLink(getObjectLink(pid, request), AtomPub.LINK_UP,
+                        AtomPub.MEDIA_TYPE_ATOM_ENTRY, null, null, -1);
             }
             // TODO don't add links if no children/decendants
-            entry.addLink(getChildrenLink(oid, request), Atom.LINK_DOWN,
-                    Atom.MEDIA_TYPE_ATOM_FEED, null, null, -1);
+            entry.addLink(getChildrenLink(oid, request), AtomPub.LINK_DOWN,
+                    AtomPub.MEDIA_TYPE_ATOM_FEED, null, null, -1);
             // TODO children descendants and folder tree
         } else if (baseType == BaseType.DOCUMENT) {
             // TODO don't add link if no parents
-            entry.addLink(getParentsLink(oid, request), Atom.LINK_UP,
-                    Atom.MEDIA_TYPE_ATOM_FEED, null, null, -1);
+            entry.addLink(getParentsLink(oid, request), AtomPub.LINK_UP,
+                    AtomPub.MEDIA_TYPE_ATOM_FEED, null, null, -1);
         }
         // entry.addLink("XXX", CMIS.LINK_ALLOWABLE_ACTIONS);
         // entry.addLink("XXX", CMIS.LINK_RELATIONSHIPS);
@@ -199,7 +200,7 @@
             return new EmptyResponseContext(400);
         }
 
-        Element obb = entry.getFirstChild(CMIS.RESTATOM_OBJECT);
+        Element obb = entry.getFirstChild(AtomPubCMIS.OBJECT);
         ObjectElement objectElement = new ObjectElement(obb, repository);
         Map<String, Serializable> properties;
         try {
@@ -244,11 +245,11 @@
         case DOCUMENT:
             ContentStream contentStream = null; // TODO
             VersioningState versioningState = null; // TODO
-            objectId = spi.createDocument(typeId, properties, folderId,
-                    contentStream, versioningState);
+            objectId = spi.createDocument(properties, folderId, contentStream,
+                    versioningState);
             break;
         case FOLDER:
-            objectId = spi.createFolder(typeId, properties, folderId);
+            objectId = spi.createFolder(properties, folderId);
             break;
         default:
             throw new UnsupportedOperationException("not implemented: "
@@ -258,9 +259,18 @@
         ObjectEntry object = spi.getProperties(objectId, null, false, false);
 
         // prepare the updated entry to return in the response
+        // AbstractEntityCollectionAdapter#getEntryFromCollectionProvider is
+        // package-private...
         entry = request.getAbdera().getFactory().newEntry();
         try {
+            // AbstractEntityCollectionAdapter#buildEntry is private...
             addEntryDetails(request, entry, null, object);
+            if (isMediaEntry(object)) {
+                IRI feedIri = null;
+                addMediaContent(feedIri, entry, object, request);
+            } else {
+                addContent(entry, object, request);
+            }
         } catch (ResponseContextException e) {
             return createErrorResponse(e);
         }
@@ -318,8 +328,8 @@
             throws ResponseContextException {
         String mediaLink = getMediaLink(object.getId(), request);
         entry.setContent(new IRI(mediaLink), getContentType(object));
-        entry.addLink(mediaLink, Atom.LINK_EDIT_MEDIA, getContentType(object),
-                null, null, getContentSize(object));
+        entry.addLink(mediaLink, AtomPub.LINK_EDIT_MEDIA,
+                getContentType(object), null, null, getContentSize(object));
         return mediaLink;
     }
 
@@ -327,7 +337,12 @@
     @Override
     public Object getContent(ObjectEntry object, RequestContext request)
             throws ResponseContextException {
-        return null;
+        Factory factory = request.getAbdera().getFactory();
+        Content content = factory.newContent();
+        content.setContentType(null);
+        String mediaLink = getMediaLink(object.getId(), request);
+        content.setSrc(mediaLink);
+        return content;
     }
 
     public long getContentSize(ObjectEntry object) {

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISParentsCollection.java Tue Aug  4 04:26:32 2009
@@ -36,7 +36,7 @@
             throws ResponseContextException {
         SPI spi = repository.getSPI(); // TODO XXX connection leak
         ObjectId objectId = spi.newObjectId(id);
-        Collection<ObjectEntry> parents = spi.getObjectParents(objectId, null, false, false);
+        Collection<ObjectEntry> parents = spi.getObjectParents(objectId, null);
         return parents;
     }
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISProvider.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISProvider.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISProvider.java Tue Aug  4 04:26:32 2009
@@ -33,8 +33,8 @@
 import org.apache.abdera.protocol.server.impl.TemplateTargetBuilder;
 import org.apache.abdera.util.Constants;
 import org.apache.chemistry.Repository;
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.URITemplate;
 
 /**
@@ -111,24 +111,24 @@
         workspaceInfo.setTitle(repository.getInfo().getName());
 
         workspaceInfo.addCollection(new CMISChildrenCollection(
-                CMIS.COL_ROOT_CHILDREN,
+                AtomPubCMIS.COL_ROOT_CHILDREN,
                 repository.getInfo().getRootFolderId().getId(), repository));
 
         workspaceInfo.addCollection(new CMISCollectionForOther(
-                CMIS.COL_ROOT_DESCENDANTS, "descendants",
+                AtomPubCMIS.COL_ROOT_DESCENDANTS, "descendants",
                 repository.getInfo().getRootFolderId().getId(), repository));
 
         workspaceInfo.addCollection(new CMISCollectionForOther(
-                CMIS.COL_UNFILED, "unfiled", null, repository));
+                AtomPubCMIS.COL_UNFILED, "unfiled", null, repository));
 
         workspaceInfo.addCollection(new CMISCollectionForOther(
-                CMIS.COL_CHECKED_OUT, "checkedout", null, repository));
+                AtomPubCMIS.COL_CHECKED_OUT, "checkedout", null, repository));
 
         workspaceInfo.addCollection(new CMISTypesCollection(
-                CMIS.COL_TYPES_CHILDREN, repository));
+                AtomPubCMIS.COL_TYPES_CHILDREN, repository));
 
         workspaceInfo.addCollection(new CMISTypesCollection(
-                CMIS.COL_TYPES_DESCENDANTS, repository));
+                AtomPubCMIS.COL_TYPES_DESCENDANTS, repository));
 
         workspaceInfo.addCollection(new CMISQueryFeed(repository));
 
@@ -146,15 +146,15 @@
             base += '/';
         }
         List<URITemplate> list = new ArrayList<URITemplate>(3);
-        list.add(new URITemplate(CMIS.URITMPL_ENTRY_BY_ID, //
-                Atom.MEDIA_TYPE_ATOM_ENTRY, //
+        list.add(new URITemplate(AtomPubCMIS.URITMPL_ENTRY_BY_ID, //
+                AtomPub.MEDIA_TYPE_ATOM_ENTRY, //
                 base + "object/{id}"));
         if (false) { // TODO
-            list.add(new URITemplate(CMIS.URITMPL_FOLDER_BY_PATH, //
-                    Atom.MEDIA_TYPE_ATOM_ENTRY, //
+            list.add(new URITemplate(AtomPubCMIS.URITMPL_FOLDER_BY_PATH, //
+                    AtomPub.MEDIA_TYPE_ATOM_ENTRY, //
                     base + "objectpath/{path}"));
-            list.add(new URITemplate(CMIS.URITMPL_QUERY, //
-                    Atom.MEDIA_TYPE_ATOM_FEED, //
+            list.add(new URITemplate(AtomPubCMIS.URITMPL_QUERY, //
+                    AtomPub.MEDIA_TYPE_ATOM_FEED, //
                     base + "query?q={q}"));
         }
         return list;

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISQueryFeed.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISQueryFeed.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISQueryFeed.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISQueryFeed.java Tue Aug  4 04:26:32 2009
@@ -28,7 +28,7 @@
 import org.apache.chemistry.ObjectEntry;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.SPI;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.abdera.QueryElement;
 
 /**
@@ -42,7 +42,7 @@
     protected String statement;
 
     public CMISQueryFeed(Repository repository) {
-        super(CMIS.COL_QUERY, "query", null, repository);
+        super(AtomPubCMIS.COL_QUERY, "query", null, repository);
     }
 
     /*

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISServiceResponse.java Tue Aug  4 04:26:32 2009
@@ -27,10 +27,11 @@
 import org.apache.abdera.protocol.server.context.StreamWriterResponseContext;
 import org.apache.abdera.writer.StreamWriter;
 import org.apache.chemistry.BaseType;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.RepositoryCapabilities;
 import org.apache.chemistry.RepositoryInfo;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.URITemplate;
 import org.w3c.dom.Document;
 
@@ -40,7 +41,7 @@
  */
 public class CMISServiceResponse extends StreamWriterResponseContext {
 
-    public static final String ATOMPUB_VERSION_SUPPORTED = "0.61";
+    public static final String ATOMPUB_VERSION_SUPPORTED = "0.62";
 
     protected final CMISProvider provider;
 
@@ -56,9 +57,10 @@
     protected void writeTo(StreamWriter sw) throws IOException {
         sw.startDocument();
         sw.startService();
-        ((StaxStreamWriter) sw).writeNamespace(CMIS.CMIS_PREFIX, CMIS.CMIS_NS);
-        ((StaxStreamWriter) sw).writeNamespace(CMIS.CMISRA_PREFIX,
-                CMIS.CMISRA_NS);
+        ((StaxStreamWriter) sw).writeNamespace(CMIS.CMIS_PREFIX,
+                CMIS.CMIS_NS);
+        ((StaxStreamWriter) sw).writeNamespace(AtomPubCMIS.CMISRA_PREFIX,
+                AtomPubCMIS.CMISRA_NS);
         for (WorkspaceInfo wi : provider.getWorkspaceManager(request).getWorkspaces(
                 request)) {
             sw.startWorkspace();
@@ -66,7 +68,7 @@
             RepositoryInfoWriter.write(sw, provider);
             for (CollectionInfo ci : wi.getCollections(request)) {
                 sw.startCollection(ci.getHref(request));
-                sw.writeAttribute(CMIS.RESTATOM_COLLECTION_TYPE,
+                sw.writeAttribute(AtomPubCMIS.COLLECTION_TYPE,
                         ((CMISCollection<?>) ci).getType());
                 sw.writeTitle(ci.getTitle(request));
                 sw.writeAccepts(ci.getAccepts(request));
@@ -75,14 +77,14 @@
             }
             // URI templates
             for (URITemplate info : provider.getURITemplates(request)) {
-                sw.startElement(CMIS.RESTATOM_URI_TEMPLATE);
-                sw.startElement(CMIS.RESTATOM_TYPE);
+                sw.startElement(AtomPubCMIS.URI_TEMPLATE);
+                sw.startElement(AtomPubCMIS.TYPE);
                 sw.writeElementText(info.type);
                 sw.endElement();
-                sw.startElement(CMIS.RESTATOM_MEDIA_TYPE);
+                sw.startElement(AtomPubCMIS.MEDIA_TYPE);
                 sw.writeElementText(info.mediaType);
                 sw.endElement();
-                sw.startElement(CMIS.RESTATOM_TEMPLATE);
+                sw.startElement(AtomPubCMIS.TEMPLATE);
                 sw.writeElementText(info.template);
                 sw.endElement();
                 sw.endElement();
@@ -114,7 +116,7 @@
             RepositoryInfo info = repository.getInfo();
             RepositoryCapabilities cap = info.getCapabilities();
 
-            sw.startElement(CMIS.RESTATOM_REPOSITORY_INFO);
+            sw.startElement(AtomPubCMIS.REPOSITORY_INFO);
             write(CMIS.REPOSITORY_ID, repository.getId());
             write(CMIS.REPOSITORY_NAME, repository.getName());
             write(CMIS.REPOSITORY_RELATIONSHIP, "self");
@@ -122,35 +124,39 @@
             write(CMIS.VENDOR_NAME, info.getVendorName());
             write(CMIS.PRODUCT_NAME, info.getProductName());
             write(CMIS.PRODUCT_VERSION, info.getProductVersion());
-            write(CMIS.VERSION_SUPPORTED, ATOMPUB_VERSION_SUPPORTED);
             write(CMIS.ROOT_FOLDER_ID, info.getRootFolderId().getId());
-            write(CMIS.CHANGES_INCOMPLETE, info.isChangeLogIncomplete());
-            write(CMIS.LATEST_CHANGE_LOG_TOKEN, info.getLatestChangeLogToken());
+            write(CMIS.LATEST_CHANGE_LOG_TOKEN,
+                    info.getLatestChangeLogToken());
 
             sw.startElement(CMIS.CAPABILITIES);
-            write(CMIS.CAPABILITY_MULTIFILING, cap.hasMultifiling());
-            write(CMIS.CAPABILITY_UNFILING, cap.hasUnfiling());
-            write(CMIS.CAPABILITY_VERSION_SPECIFIC_FILING,
-                    cap.hasVersionSpecificFiling());
-            write(CMIS.CAPABILITY_PWC_UPDATEABLE, cap.isPWCUpdatable());
-            write(CMIS.CAPABILITY_PWC_SEARCHABLE, cap.isPWCSearchable());
+            write(CMIS.CAPABILITY_ACL, cap.getACLCapability().toString());
             write(CMIS.CAPABILITY_ALL_VERSIONS_SEARCHABLE,
                     cap.isAllVersionsSearchable());
-            write(CMIS.CAPABILITY_CAN_GET_DESCENDANTS, cap.hasGetDescendants());
+            write(CMIS.CAPABILITY_CHANGES,
+                    cap.getJoinCapability().toString());
+            for (BaseType t : info.getChangeLogBaseTypes()) {
+                write(CMIS.CAPABILITY_CHANGES_ON_TYPE, t.toString());
+            }
             write(CMIS.CAPABILITY_CONTENT_STREAM_UPDATABILITY,
                     cap.isContentStreamUpdatableAnytime() ? "anytime"
                             : "pwconly");
+            write(CMIS.CAPABILITY_CAN_GET_DESCENDANTS,
+                    cap.hasGetDescendants());
+            write(CMIS.CAPABILITY_MULTIFILING, cap.hasMultifiling());
+            write(CMIS.CAPABILITY_PWC_SEARCHABLE, cap.isPWCSearchable());
+            write(CMIS.CAPABILITY_PWC_UPDATEABLE, cap.isPWCUpdatable());
             write(CMIS.CAPABILITY_QUERY, cap.getQueryCapability().toString());
-            write(CMIS.CAPABILITY_JOIN, cap.getJoinCapability().toString());
             write(CMIS.CAPABILITY_RENDITIONS,
                     cap.getRenditionCapability().toString());
-            write(CMIS.CAPABILITY_ACL, cap.getACLCapability().toString());
-            write(CMIS.CAPABILITY_CHANGES, cap.getJoinCapability().toString());
-            for (BaseType t : info.getChangeLogBaseTypes()) {
-                write(CMIS.CAPABILITY_CHANGES_ON_TYPE, t.toString());
-            }
+            write(CMIS.CAPABILITY_UNFILING, cap.hasUnfiling());
+            write(CMIS.CAPABILITY_VERSION_SPECIFIC_FILING,
+                    cap.hasVersionSpecificFiling());
+            write(CMIS.CAPABILITY_JOIN, cap.getJoinCapability().toString());
             sw.endElement();
 
+            write(CMIS.VERSION_SUPPORTED, ATOMPUB_VERSION_SUPPORTED);
+            // write(CMISXML.THIN_CLIENT_URI, "TODO");
+            write(CMIS.CHANGES_INCOMPLETE, info.isChangeLogIncomplete());
             write(CMIS.REPOSITORY_SPECIFIC_INFORMATION,
                     info.getRepositorySpecificInformation());
             sw.endElement();
@@ -169,6 +175,9 @@
         }
 
         private void write(QName qname, Document document) {
+            if (document == null) {
+                return;
+            }
             sw.startElement(qname);
             // XXX TODO
             sw.endElement();

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java Tue Aug  4 04:26:32 2009
@@ -32,11 +32,11 @@
 import org.apache.abdera.model.Person;
 import org.apache.abdera.protocol.server.RequestContext;
 import org.apache.abdera.protocol.server.context.ResponseContextException;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.PropertyDefinition;
 import org.apache.chemistry.PropertyType;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.Type;
-import org.apache.chemistry.atompub.CMIS;
 import org.apache.chemistry.atompub.abdera.PropertiesElement;
 
 /**
@@ -59,8 +59,7 @@
         feed.declareNS(CMIS.CMIS_NS, CMIS.CMIS_PREFIX);
         feed.setId(getId(request));
         feed.setTitle(getTitle(request));
-        // feed.addLink("");
-        // feed.addLink("", "self");
+        feed.addLink(request.getResolvedUri().toString(), "self");
         feed.addAuthor(getAuthor(request));
         feed.setUpdated(new Date()); // XXX fixed date
         return feed;
@@ -314,10 +313,9 @@
     }
 
     @Override
-    public Type getEntry(String resourceName, RequestContext request)
+    public Type getEntry(String typeId, RequestContext request)
             throws ResponseContextException {
-        // TODO Auto-generated method stub
-        throw new UnsupportedOperationException();
+        return repository.getType(typeId);
     }
 
     @Override

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISWorkspaceManager.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISWorkspaceManager.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISWorkspaceManager.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISWorkspaceManager.java Tue Aug  4 04:26:32 2009
@@ -42,6 +42,9 @@
         if (paths.startsWith("/types/") || paths.startsWith("/types?")) {
             return new CMISTypesCollection(null, repository);
         }
+        if (paths.startsWith("/type/")) {
+            return new CMISTypesCollection(null, repository);
+        }
         if (paths.startsWith("/children/")) {
             String id = request.getTarget().getParameter("objectid");
             return new CMISChildrenCollection(null, id, repository);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java Tue Aug  4 04:26:32 2009
@@ -36,8 +36,8 @@
 import org.apache.abdera.protocol.server.impl.AbstractCollectionAdapter;
 import org.apache.abdera.protocol.server.servlet.ServletRequestContext;
 import org.apache.chemistry.Repository;
-import org.apache.chemistry.atompub.Atom;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPub;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.server.CMISProvider;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -140,7 +140,7 @@
     }
 
     @GET
-    @Produces(Atom.MEDIA_TYPE_ATOM_SERVICE)
+    @Produces(AtomPub.MEDIA_TYPE_ATOM_SERVICE)
     @Path("repository")
     public Response doGetRepository(@Context HttpServletRequest httpRequest) {
         RequestContext requestContext = getRequestContext(1);
@@ -149,14 +149,14 @@
     }
 
     @GET
-    @Produces(Atom.MEDIA_TYPE_ATOM_FEED)
+    @Produces(AtomPub.MEDIA_TYPE_ATOM_FEED)
     @Path("types")
     public Response doGetTypes() {
         return getAbderaFeed(1);
     }
 
     @GET
-    @Produces(Atom.MEDIA_TYPE_ATOM_FEED)
+    @Produces(AtomPub.MEDIA_TYPE_ATOM_FEED)
     @Path("children/{objectid}")
     public Response doGetChildren() {
         // objectid decoded by Abdera getCollectionAdapter
@@ -164,7 +164,7 @@
     }
 
     @GET
-    @Produces(Atom.MEDIA_TYPE_ATOM_ENTRY)
+    @Produces(AtomPub.MEDIA_TYPE_ATOM_ENTRY)
     @Path("object/{objectid}")
     public Response doGetObject() {
         // objectid decoded by Abdera getCollectionAdapter
@@ -183,8 +183,8 @@
     }
 
     @POST
-    @Consumes(CMIS.MEDIA_TYPE_CMIS_QUERY)
-    @Produces(Atom.MEDIA_TYPE_ATOM_FEED)
+    @Consumes(AtomPubCMIS.MEDIA_TYPE_CMIS_QUERY)
+    @Produces(AtomPub.MEDIA_TYPE_ATOM_FEED)
     @Path("query")
     public Response doPostQuery() {
         return getAbderaPostFeed(1);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java Tue Aug  4 04:26:32 2009
@@ -30,6 +30,7 @@
 import org.apache.abdera.protocol.util.AbstractEntityProvider;
 import org.apache.abdera.writer.StreamWriter;
 import org.apache.chemistry.BaseType;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.Connection;
 import org.apache.chemistry.ContentStream;
 import org.apache.chemistry.ContentStreamPresence;
@@ -39,7 +40,7 @@
 import org.apache.chemistry.PropertyType;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.Updatability;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.impl.simple.SimpleContentStream;
 import org.apache.chemistry.impl.simple.SimplePropertyDefinition;
 import org.apache.chemistry.impl.simple.SimpleRepository;
@@ -162,7 +163,7 @@
         Service root = (Service) resp.getDocument().getRoot();
         Workspace workspace = root.getWorkspaces().get(0);
         assertNotNull(root);
-        Element info = workspace.getFirstChild(CMIS.RESTATOM_REPOSITORY_INFO);
+        Element info = workspace.getFirstChild(AtomPubCMIS.REPOSITORY_INFO);
         assertNotNull(info);
 
         resp = client.get(base + "/types");
@@ -209,7 +210,7 @@
 
         @Override
         public String getContentType() {
-            return CMIS.MEDIA_TYPE_CMIS_QUERY;
+            return AtomPubCMIS.MEDIA_TYPE_CMIS_QUERY;
         }
 
         public boolean isRepeatable() {
@@ -221,8 +222,8 @@
             sw.startElement("query", CMIS.CMIS_NS, CMIS.CMIS_PREFIX);
             sw.startElement("statement", CMIS.CMIS_NS, CMIS.CMIS_PREFIX).writeElementText(
                     statement).endElement();
-            sw.startElement("searchAllVersions", CMIS.CMIS_NS, CMIS.CMIS_PREFIX).writeElementText(
-                    "false").endElement();
+            sw.startElement("searchAllVersions", CMIS.CMIS_NS,
+                    CMIS.CMIS_PREFIX).writeElementText("false").endElement();
             sw.startElement("pageSize", CMIS.CMIS_NS, CMIS.CMIS_PREFIX).writeElementText(
                     0).endElement();
             sw.startElement("skipCount", CMIS.CMIS_NS, CMIS.CMIS_PREFIX).writeElementText(

Copied: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPub.java (from r798963, incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPub.java?p2=incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPub.java&p1=incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java&r1=798963&r2=800672&rev=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/Atom.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPub.java Tue Aug  4 04:26:32 2009
@@ -21,16 +21,24 @@
 /**
  * Utility class providing various Atom- and AtomPub-related constants.
  */
-public class Atom {
+public class AtomPub {
 
     // utility class
-    private Atom() {
+    private AtomPub() {
     }
 
+    /*
+     * ----- Namespaces -----
+     */
+
     public static final String ATOM_NS = "http://www.w3.org/2005/Atom";
 
     public static final String APP_NS = "http://www.w3.org/2007/app";
 
+    /*
+     * ----- XML Qualified Names-----
+     */
+
     public static final QName ATOM_FEED = new QName(ATOM_NS, "feed");
 
     public static final QName ATOM_ENTRY = new QName(ATOM_NS, "entry");
@@ -39,6 +47,10 @@
 
     public static final QName APP_COLLECTION = new QName(APP_NS, "collection");
 
+    /*
+     * ----- Media Types -----
+     */
+
     public static final String MEDIA_TYPE_ATOM = "application/atom+xml";
 
     public static final String MEDIA_TYPE_ATOM_ENTRY = "application/atom+xml;type=entry";
@@ -48,6 +60,10 @@
     public static final String MEDIA_TYPE_ATOM_SERVICE = "application/atomsvc+xml";
 
     /*
+     * ----- Link Types -----
+     */
+
+    /*
      * http://www.iana.org/assignments/link-relations/link-relations.xhtml
      */
 
@@ -82,14 +98,14 @@
     public static final String LINK_DOWN = "down";
 
     /*
-     * TODO Will be updated by 0.63 to use properly
+     * TODO-0.63 update to use properly
      * http://www.ietf.org/id/draft-brown-versioning-link-relations-01.txt
      */
 
-    public static final String LINK_VERSION_HISTORY = "allversions"; // TODO
+    public static final String LINK_VERSION_HISTORY = "allversions"; // TODO-0.63
 
-    public static final String LINK_LATEST_VERSION = "latestversion"; // TODO
+    public static final String LINK_LATEST_VERSION = "latestversion"; // TODO-0.63
 
-    public static final String LINK_WORKING_COPY = "pwc"; // TODO
+    public static final String LINK_WORKING_COPY = "pwc"; // TODO-0.63
 
 }

Propchange: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPub.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPub.java
------------------------------------------------------------------------------
    svn:keywords = Id

Copied: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPubCMIS.java (from r800161, incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java)
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPubCMIS.java?p2=incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPubCMIS.java&p1=incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java&r1=800161&r2=800672&rev=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/CMIS.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPubCMIS.java Tue Aug  4 04:26:32 2009
@@ -18,251 +18,50 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.chemistry.CMIS;
+
 /**
  * Utility class providing CMIS constants and names for AtomPub.
  */
-public class CMIS {
+public class AtomPubCMIS {
 
     // utility class
-    private CMIS() {
+    private AtomPubCMIS() {
     }
 
-    public static final String CMIS_NS_BASE = "http://docs.oasis-open.org/ns/cmis/";
-
-    public static final String CMIS_NS = CMIS_NS_BASE + "core/200901";
-
-    public static final String CMIS_PREFIX = "cmis";
+    /*
+     * ----- Namespaces -----
+     */
 
-    public static final String CMISRA_NS = CMIS_NS_BASE + "restatom/200901";
+    public static final String CMISRA_NS = CMIS.CMIS_NS_BASE
+            + "restatom/200901";
 
     public static final String CMISRA_PREFIX = "cmisra";
 
-    public static QName CMISName(String localPart) {
-        return new QName(CMIS_NS, localPart, CMIS_PREFIX);
-    }
-
     public static QName CMISRAName(String localPart) {
         return new QName(CMISRA_NS, localPart, CMISRA_PREFIX);
     }
 
     /*
-     * ----- XML Qualified Names -----
-     */
-
-    public static final QName REPOSITORY_ID = CMISName("repositoryId");
-
-    public static final QName REPOSITORY_NAME = CMISName("repositoryName");
-
-    public static final QName REPOSITORY_RELATIONSHIP = CMISName("repositoryRelationship");
-
-    public static final QName REPOSITORY_DESCRIPTION = CMISName("repositoryDescription");
-
-    public static final QName VENDOR_NAME = CMISName("vendorName");
-
-    public static final QName PRODUCT_NAME = CMISName("productName");
-
-    public static final QName PRODUCT_VERSION = CMISName("productVersion");
-
-    public static final QName ROOT_FOLDER_ID = CMISName("rootFolderId");
-
-    public static final QName LATEST_CHANGE_LOG_TOKEN = CMISName("latestChangeToken"); // TODO-0.63
-
-    public static final QName CAPABILITIES = CMISName("capabilities");
-
-    public static final QName CAPABILITY_MULTIFILING = CMISName("capabilityMultifiling");
-
-    public static final QName CAPABILITY_UNFILING = CMISName("capabilityUnfiling");
-
-    public static final QName CAPABILITY_VERSION_SPECIFIC_FILING = CMISName("capabilityVersionSpecificFiling");
-
-    public static final QName CAPABILITY_PWC_UPDATEABLE = CMISName("capabilityPWCUpdateable");
-
-    public static final QName CAPABILITY_PWC_SEARCHABLE = CMISName("capabilityPWCSearchable");
-
-    public static final QName CAPABILITY_ALL_VERSIONS_SEARCHABLE = CMISName("capabilityAllVersionsSearchable");
-
-    public static final QName CAPABILITY_CAN_GET_DESCENDANTS = CMISName("capabilityGetDescendants");
-
-    public static final QName CAPABILITY_CONTENT_STREAM_UPDATABILITY = CMISName("capabilityContentStreamUpdatability");
-
-    public static final QName CAPABILITY_QUERY = CMISName("capabilityQuery");
-
-    public static final QName CAPABILITY_JOIN = CMISName("capabilityJoin");
-
-    public static final QName CAPABILITY_RENDITIONS = CMISName("capabilityRenditions");
-
-    public static final QName CAPABILITY_CHANGES = CMISName("capabilityChanges");
-
-    public static final QName CAPABILITY_CHANGES_ON_TYPE = CMISName("capabilityChangesOnType");
-
-    public static final QName CAPABILITY_ACL = CMISName("capabilityACL");
-
-    public static final QName CHANGES_INCOMPLETE = CMISName("changesIncomplete");
-
-    public static final QName ACL_CAPABILITY = CMISName("aclCapability");
-
-    public static final QName SET_TYPE = CMISName("setType");
-
-    public static final QName PERMISSIONS = CMISName("permissions");
-
-    public static final QName MAPPING = CMISName("mapping");
-
-    public static final QName KEY = CMISName("key");
-
-    public static final QName PERMISSION = CMISName("permission");
-
-    public static final QName VERSION_SUPPORTED = CMISName("cmisVersionSupported");
-
-    public static final QName REPOSITORY_SPECIFIC_INFORMATION = CMISName("repositorySpecificInformation");
-
-    public static final QName DOCUMENT_TYPE = CMISName("documentType");
-
-    public static final QName FOLDER_TYPE = CMISName("folderType");
-
-    public static final QName RELATIONSHIP_TYPE = CMISName("relationshipType");
-
-    public static final QName POLICY_TYPE = CMISName("policyType");
-
-    public static final QName BASE_TYPE_ID = CMISName("baseTypeId");
-
-    public static final QName ID = CMISName("id");
-
-    public static final QName LOCAL_NAME = CMISName("localName");
-
-    public static final QName LOCAL_NAMESPACE = CMISName("localNamespace");
-
-    public static final QName QUERY_NAME = CMISName("queryName");
-
-    public static final QName DISPLAY_NAME = CMISName("displayName");
-
-    public static final QName PARENT_ID = CMISName("parentId");
-
-    public static final QName DESCRIPTION = CMISName("description");
-
-    public static final QName CREATABLE = CMISName("creatable");
-
-    public static final QName FILEABLE = CMISName("fileable");
-
-    public static final QName QUERYABLE = CMISName("queryable");
-
-    public static final QName CONTROLLABLE_POLICY = CMISName("controllablePolicy");
-
-    public static final QName CONTROLLABLE_ACL = CMISName("controllableACL");
-
-    public static final QName FULLTEXT_INDEXED = CMISName("fulltextindexed");
-
-    public static final QName VERSIONABLE = CMISName("versionable");
-
-    public static final QName CONTENT_STREAM_ALLOWED = CMISName("contentStreamAllowed");
-
-    public static final QName INCLUDED_IN_SUPERTYPE_QUERY = CMISName("includedInSupertypeQuery");
-
-    public static final QName PROPERTY_STRING_DEFINITION = CMISName("propertyStringDefinition");
-
-    public static final QName PROPERTY_DECIMAL_DEFINITION = CMISName("propertyDecimalDefinition");
-
-    public static final QName PROPERTY_INTEGER_DEFINITION = CMISName("propertyIntegerDefinition");
-
-    public static final QName PROPERTY_BOOLEAN_DEFINITION = CMISName("propertyBooleanDefinition");
-
-    public static final QName PROPERTY_DATETIME_DEFINITION = CMISName("propertyDateTimeDefinition");
-
-    public static final QName PROPERTY_URI_DEFINITION = CMISName("propertyUriDefinition");
-
-    public static final QName PROPERTY_ID_DEFINITION = CMISName("propertyIdDefinition");
-
-    public static final QName PROPERTY_XML_DEFINITION = CMISName("propertyXmlDefinition");
-
-    public static final QName PROPERTY_HTML_DEFINITION = CMISName("propertyHtmlDefinition");
-
-    public static final QName PROPERTY_XHTML_DEFINITION = CMISName("propertyXhtmlDefinition");
-
-    public static final QName PROPERTY_TYPE = CMISName("propertyType");
-
-    public static final QName CARDINALITY = CMISName("cardinality");
-
-    public static final QName UPDATABILITY = CMISName("updatability");
-
-    public static final QName INHERITED = CMISName("inherited");
-
-    public static final QName REQUIRED = CMISName("required");
-
-    public static final QName ORDERABLE = CMISName("orderable");
-
-    public static final QName DEFAULT_VALUE = CMISName("defaultValue");
-
-    public static final QName PROPERTIES = CMISName("properties");
-
-    public static final QName PROPERTY_STRING = CMISName("propertyString");
-
-    public static final QName PROPERTY_DECIMAL = CMISName("propertyDecimal");
-
-    public static final QName PROPERTY_INTEGER = CMISName("propertyInteger");
-
-    public static final QName PROPERTY_BOOLEAN = CMISName("propertyBoolean");
-
-    public static final QName PROPERTY_DATETIME = CMISName("propertyDateTime");
-
-    public static final QName PROPERTY_URI = CMISName("propertyUri");
-
-    public static final QName PROPERTY_ID = CMISName("propertyId");
-
-    public static final QName PROPERTY_XML = CMISName("propertyXml");
-
-    public static final QName PROPERTY_HTML = CMISName("propertyHtml");
-
-    public static final QName PROPERTY_XHTML = CMISName("propertyXhtml");
-
-    public static final QName VALUE = CMISName("value");
-
-    public static final QName ALLOWABLE_ACTIONS = CMISName("allowableActions");
-
-    public static final QName CHANGE_EVENT_INFO = CMISName("changeEventInfo");
-
-    public static final QName CHANGE_TYPE = CMISName("changeType");
-
-    public static final QName CHANGE_TIME = CMISName("changeTime");
-
-    public static final QName QUERY = CMISName("query");
-
-    public static final QName STATEMENT = CMISName("statement");
-
-    public static final QName SEARCH_ALL_VERSIONS = CMISName("searchAllVersions");
-
-    public static final QName MAX_ITEMS = CMISName("maxItems");
-
-    public static final QName SKIP_COUNT = CMISName("skipCount");
-
-    public static final QName INCLUDE_ALLOWABLE_ACTIONS = CMISName("includeAllowableActions");
-
-    // no namespace for attributes
-
-    public static final QName PDID = new QName("pdid");
-
-    public static final QName LOCALNAME = new QName("localname");
-
-    public static final QName DISPLAYNAME = new QName("displayname");
-
-    /*
-     * ----- CMIS REST Atom Qualified Names-----
+     * ----- XML Qualified Names-----
      */
 
-    public static final QName RESTATOM_REPOSITORY_INFO = CMISRAName("repositoryInfo");
+    public static final QName REPOSITORY_INFO = CMISRAName("repositoryInfo");
 
-    public static final QName RESTATOM_COLLECTION_TYPE = CMISRAName("collectionType");
+    public static final QName COLLECTION_TYPE = CMISRAName("collectionType");
 
-    public static final QName RESTATOM_URI_TEMPLATE = CMISRAName("uritemplate");
+    public static final QName URI_TEMPLATE = CMISRAName("uritemplate");
 
-    public static final QName RESTATOM_TEMPLATE = CMISRAName("template");
+    public static final QName TEMPLATE = CMISRAName("template");
 
-    public static final QName RESTATOM_TYPE = CMISRAName("type");
+    public static final QName TYPE = CMISRAName("type");
 
-    public static final QName RESTATOM_MEDIA_TYPE = CMISRAName("mediatype");
+    public static final QName MEDIA_TYPE = CMISRAName("mediatype");
 
-    public static final QName RESTATOM_OBJECT = CMISRAName("object");
+    public static final QName OBJECT = CMISRAName("object");
 
     /*
-     * ----- CMIS Collection Types -----
+     * ----- AtomPub Collection Types -----
      */
 
     public static final String COL_ROOT_CHILDREN = "root";
@@ -280,10 +79,10 @@
     public static final String COL_QUERY = "query";
 
     /*
-     * ----- CMIS Link Types -----
+     * ----- AtomPub Link Types -----
      */
 
-    public static final String CMIS_LINK_NS_BASE = CMIS_NS_BASE
+    public static final String CMIS_LINK_NS_BASE = CMIS.CMIS_NS_BASE
             + "link/200901/";
 
     public static final String LINK_SOURCE = CMIS_LINK_NS_BASE + "source";
@@ -312,7 +111,7 @@
             + "rootdescendants";
 
     /*
-     * ----- CMIS URI Template Types -----
+     * ----- URI Template Types -----
      */
 
     public static final String URITMPL_ENTRY_BY_ID = "entrybyid";
@@ -322,7 +121,7 @@
     public static final String URITMPL_QUERY = "query";
 
     /*
-     * ----- CMIS Media Types -----
+     * ----- Media Types -----
      */
 
     public static final String MEDIA_TYPE_CMIS_QUERY = "application/cmisquery+xml";

Propchange: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPubCMIS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/AtomPubCMIS.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision Rev Url

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/ValueAdapter.java Tue Aug  4 04:26:32 2009
@@ -28,6 +28,7 @@
 
 import javax.xml.namespace.QName;
 
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.PropertyType;
 import org.apache.chemistry.util.GregorianCalendar;
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/AllowableActionsElement.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/AllowableActionsElement.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/AllowableActionsElement.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/AllowableActionsElement.java Tue Aug  4 04:26:32 2009
@@ -18,7 +18,7 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.ExtensibleElementWrapper;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
 
 /**
  * Abdera ElementWrapper for an AtomPub cmis:allowableActions element.

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/ObjectElement.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/ObjectElement.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/ObjectElement.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/ObjectElement.java Tue Aug  4 04:26:32 2009
@@ -23,10 +23,11 @@
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.ExtensibleElementWrapper;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.ObjectEntry;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.Type;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.atompub.AtomPubCMIS;
 
 /**
  * Abdera ElementWrapper for an AtomPub cmis:object element.
@@ -51,7 +52,7 @@
      * Constructor used when generating XML.
      */
     public ObjectElement(Factory factory, ObjectEntry object, Type type) {
-        super(factory, CMIS.RESTATOM_OBJECT);
+        super(factory, AtomPubCMIS.OBJECT);
         properties = new PropertiesElement(getFactory());
         addExtension(properties);
         setProperties(object.getValues(), type);

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java Tue Aug  4 04:26:32 2009
@@ -35,12 +35,12 @@
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.ExtensibleElement;
 import org.apache.abdera.model.ExtensibleElementWrapper;
+import org.apache.chemistry.CMIS;
 import org.apache.chemistry.Property;
 import org.apache.chemistry.PropertyDefinition;
 import org.apache.chemistry.PropertyType;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.Type;
-import org.apache.chemistry.atompub.CMIS;
 import org.apache.chemistry.atompub.ValueAdapter;
 
 /**

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/QueryElement.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/QueryElement.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/QueryElement.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/QueryElement.java Tue Aug  4 04:26:32 2009
@@ -24,7 +24,7 @@
 import org.apache.abdera.model.ExtensibleElementWrapper;
 import org.apache.abdera.parser.stax.FOMElement;
 import org.apache.axiom.om.OMElement;
-import org.apache.chemistry.atompub.CMIS;
+import org.apache.chemistry.CMIS;
 
 /**
  * Element wrapping for a CMIS query.

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/cmissql/CmisSqlParser.g
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/cmissql/CmisSqlParser.g?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/cmissql/CmisSqlParser.g (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/cmissql/CmisSqlParser.g Tue Aug  4 04:26:32 2009
@@ -110,7 +110,7 @@
 join_type: INNER | LEFT OUTER?;
 
 join_specification:
-    ON^ LPAR! column_reference EQ! column_reference RPAR!;
+    ON^ column_reference EQ! column_reference;
 
 where_clause: WHERE^ search_condition;
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseObject.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseObject.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseObject.java Tue Aug  4 04:26:32 2009
@@ -210,8 +210,8 @@
         return getId(Property.VERSION_SERIES_CHECKED_OUT_ID);
     }
 
-    public String getCheckinComment() {
-        return getString(Property.CHECKIN_COMMENT);
+    public String getCheckInComment() {
+        return getString(Property.CHECK_IN_COMMENT);
     }
 
     public void setName(String value) {

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseRepository.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseRepository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseRepository.java Tue Aug  4 04:26:32 2009
@@ -132,7 +132,7 @@
     }
 
     public String getVersionSupported() {
-        return "0.61";
+        return "0.62";
     }
 
     public org.w3c.dom.Document getRepositorySpecificInformation() {

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java Tue Aug  4 04:26:32 2009
@@ -255,9 +255,8 @@
         }
     }
 
-    public ObjectEntry getFolderParent(ObjectId folder, String filter,
-            boolean includeAllowableActions, boolean includeRelationships) {
-        // TODO filter, includeRelationship, includeAllowableActions
+    public ObjectEntry getFolderParent(ObjectId folder, String filter) {
+        // TODO filter
         String folderId = folder.getId();
         SimpleData data = repository.datas.get(folderId);
         if (data == null) {
@@ -281,9 +280,7 @@
     }
 
     public Collection<ObjectEntry> getObjectParents(ObjectId object,
-            String filter, boolean includeAllowableActions,
-            boolean includeRelationships) {
-        // TODO includeAllowableActions and includeRelationships
+            String filter) {
         // TODO filter
         Set<String> ids = repository.parents.get(object.getId());
         List<ObjectEntry> parents = new ArrayList<ObjectEntry>(ids.size());
@@ -398,10 +395,14 @@
         }
     }
 
-    public ObjectId createDocument(String typeId,
-            Map<String, Serializable> properties, ObjectId folder,
-            ContentStream contentStream, VersioningState versioningState) {
+    public ObjectId createDocument(Map<String, Serializable> properties,
+            ObjectId folder, ContentStream contentStream,
+            VersioningState versioningState) {
         // TODO contentStream, versioningState
+        String typeId = (String) properties.get(Property.TYPE_ID);
+        if (typeId == null) {
+            throw new IllegalArgumentException("Missing obejct type id");
+        }
         Type type = repository.getType(typeId);
         if (type == null || type.getBaseType() != BaseType.DOCUMENT) {
             throw new IllegalArgumentException(typeId);
@@ -415,8 +416,12 @@
         return new SimpleObjectId((String) data.get(Property.ID));
     }
 
-    public ObjectId createFolder(String typeId,
-            Map<String, Serializable> properties, ObjectId folder) {
+    public ObjectId createFolder(Map<String, Serializable> properties,
+            ObjectId folder) {
+        String typeId = (String) properties.get(Property.TYPE_ID);
+        if (typeId == null) {
+            throw new IllegalArgumentException("Missing obejct type id");
+        }
         Type type = repository.getType(typeId);
         if (type == null || type.getBaseType() != BaseType.FOLDER) {
             throw new IllegalArgumentException(typeId);
@@ -430,15 +435,13 @@
         return new SimpleObjectId((String) data.get(Property.ID));
     }
 
-    public ObjectId createRelationship(String typeId,
-            Map<String, Serializable> properties, ObjectId source,
-            ObjectId target) {
+    public ObjectId createRelationship(Map<String, Serializable> properties) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
 
-    public ObjectId createPolicy(String typeId,
-            Map<String, Serializable> properties, ObjectId folder) {
+    public ObjectId createPolicy(Map<String, Serializable> properties,
+            ObjectId folder) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }
@@ -498,7 +501,7 @@
         }
         // length is recomputed, no need to read it
         String mimeType = (String) data.get(Property.CONTENT_STREAM_MIME_TYPE);
-        String filename = (String) data.get(Property.CONTENT_STREAM_FILENAME);
+        String filename = (String) data.get(Property.CONTENT_STREAM_FILE_NAME);
         return new SimpleContentStream(bytes, mimeType, filename);
     }
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleContentStream.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleContentStream.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleContentStream.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleContentStream.java Tue Aug  4 04:26:32 2009
@@ -69,7 +69,7 @@
         return mimeType;
     }
 
-    public String getFilename() {
+    public String getFileName() {
         return filename;
     }
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleDocument.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleDocument.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleDocument.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleDocument.java Tue Aug  4 04:26:32 2009
@@ -71,7 +71,7 @@
         }
         // length is recomputed, no need to read it
         String mimeType = getString(Property.CONTENT_STREAM_MIME_TYPE);
-        String filename = getString(Property.CONTENT_STREAM_FILENAME);
+        String filename = getString(Property.CONTENT_STREAM_FILE_NAME);
         return new SimpleContentStream(contentBytes, mimeType, filename);
     }
 
@@ -87,7 +87,7 @@
         if (contentStream == null) {
             entry.setValue(Property.CONTENT_STREAM_LENGTH, null);
             entry.setValue(Property.CONTENT_STREAM_MIME_TYPE, null);
-            entry.setValue(Property.CONTENT_STREAM_FILENAME, null);
+            entry.setValue(Property.CONTENT_STREAM_FILE_NAME, null);
             entry.setValue(SimpleProperty.CONTENT_BYTES_KEY, null);
         } else {
             entry.setValue(Property.CONTENT_STREAM_LENGTH,
@@ -95,8 +95,8 @@
                                                                        // Long
             entry.setValue(Property.CONTENT_STREAM_MIME_TYPE,
                     contentStream.getMimeType());
-            entry.setValue(Property.CONTENT_STREAM_FILENAME,
-                    contentStream.getFilename());
+            entry.setValue(Property.CONTENT_STREAM_FILE_NAME,
+                    contentStream.getFileName());
             entry.setValue(SimpleProperty.CONTENT_BYTES_KEY,
                     SimpleContentStream.getBytes(contentStream.getStream()));
         }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObjectEntry.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObjectEntry.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObjectEntry.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObjectEntry.java Tue Aug  4 04:26:32 2009
@@ -21,6 +21,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.xml.namespace.QName;
+
 import org.apache.chemistry.BaseType;
 import org.apache.chemistry.ChangeInfo;
 import org.apache.chemistry.ObjectEntry;
@@ -87,7 +89,7 @@
         }
     }
 
-    public Collection<String> getAllowableActions() {
+    public Map<QName, Boolean> getAllowableActions() {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java?rev=800672&r1=800671&r2=800672&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRepository.java Tue Aug  4 04:26:32 2009
@@ -26,16 +26,16 @@
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.chemistry.ACLCapability;
+import org.apache.chemistry.CapabilityACL;
 import org.apache.chemistry.ACLCapabilityType;
 import org.apache.chemistry.BaseType;
-import org.apache.chemistry.ChangeCapability;
+import org.apache.chemistry.CapabilityChange;
 import org.apache.chemistry.Connection;
-import org.apache.chemistry.JoinCapability;
+import org.apache.chemistry.CapabilityJoin;
 import org.apache.chemistry.ObjectId;
 import org.apache.chemistry.Property;
-import org.apache.chemistry.QueryCapability;
-import org.apache.chemistry.RenditionCapability;
+import org.apache.chemistry.CapabilityQuery;
+import org.apache.chemistry.CapabilityRendition;
 import org.apache.chemistry.SPI;
 import org.apache.chemistry.impl.base.BaseRepository;
 
@@ -98,12 +98,11 @@
      * ----- RepositoryEntry -----
      */
 
-    public URI getURI() {
-        // TODO Return a URI
+    public String getRelationshipName() {
         return null;
     }
 
-    public String getRelationshipName() {
+    public URI getThinClientURI() {
         return null;
     }
 
@@ -142,7 +141,13 @@
     }
 
     public Set<BaseType> getChangeLogBaseTypes() {
-        return Collections.emptySet();
+        // TODO-0.63 TCK checks 0.62 schema which has minOccurs=1
+        Set<BaseType> changeLogBaseTypes = new HashSet<BaseType>();
+        changeLogBaseTypes.add(BaseType.DOCUMENT);
+        changeLogBaseTypes.add(BaseType.FOLDER);
+        changeLogBaseTypes.add(BaseType.RELATIONSHIP);
+        changeLogBaseTypes.add(BaseType.POLICY);
+        return changeLogBaseTypes;
     }
 
     public boolean isChangeLogIncomplete() {
@@ -195,24 +200,24 @@
         return true;
     }
 
-    public JoinCapability getJoinCapability() {
-        return JoinCapability.NONE;
+    public CapabilityJoin getJoinCapability() {
+        return CapabilityJoin.NONE;
     }
 
-    public QueryCapability getQueryCapability() {
-        return QueryCapability.BOTH_COMBINED;
+    public CapabilityQuery getQueryCapability() {
+        return CapabilityQuery.BOTH_COMBINED;
     }
 
-    public RenditionCapability getRenditionCapability() {
-        return RenditionCapability.NONE;
+    public CapabilityRendition getRenditionCapability() {
+        return CapabilityRendition.NONE;
     }
 
-    public ChangeCapability getChangeCapability() {
-        return ChangeCapability.NONE;
+    public CapabilityChange getChangeCapability() {
+        return CapabilityChange.NONE;
     }
 
-    public ACLCapability getACLCapability() {
-        return ACLCapability.NONE;
+    public CapabilityACL getACLCapability() {
+        return CapabilityACL.NONE;
     }
 
 }



Mime
View raw message