chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r796853 - 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/test/resources/ chemistry-atompub-...
Date Wed, 22 Jul 2009 19:35:09 GMT
Author: fguillaume
Date: Wed Jul 22 19:35:08 2009
New Revision: 796853

URL: http://svn.apache.org/viewvc?rev=796853&view=rev
Log:
CMIS-44: added "cmis:" prefix to CMIS-defined type and property ids

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeEntryReader.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/resources/feed-types.xml
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub/src/main/java/org/apache/chemistry/atompub/abdera/PropertiesElement.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/pom.xml
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/impl/simple/CmisSqlSimpleWalker.g
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/base/BaseRepository.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleData.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/pom.xml
    incubator/chemistry/trunk/chemistry/chemistry-parent/pom.xml
    incubator/chemistry/trunk/chemistry/chemistry-tests/pom.xml
    incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicHelper.java
    incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
    incubator/chemistry/trunk/chemistry/chemistry-tests/src/test/java/org/apache/chemistry/test/TestAtomPubClientServer.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/BaseType.java
Wed Jul 22 19:35:08 2009
@@ -27,26 +27,26 @@
     /**
      * A document represents a standalone information asset.
      */
-    DOCUMENT("document"),
+    DOCUMENT("cmis:document"),
 
     /**
      * A folder represents a logical container for a collection of fileable
      * objects, which include folders and documents. Folders are used to
      * organize fileable objects.
      */
-    FOLDER("folder"),
+    FOLDER("cmis:folder"),
 
     /**
      * A relationship represents a directional relationship between two
      * independent objects.
      */
-    RELATIONSHIP("relationship"),
+    RELATIONSHIP("cmis:relationship"),
 
     /**
      * A policy represents an administrative policy, which may be applied to one
      * or more controllable objects
      */
-    POLICY("policy");
+    POLICY("cmis:policy");
 
     private final String value;
 
@@ -69,6 +69,10 @@
         return o;
     }
 
+    public String getId() {
+        return value;
+    }
+
     @Override
     public String toString() {
         return value;

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
Wed Jul 22 19:35:08 2009
@@ -27,82 +27,82 @@
      * ----- Object -----
      */
 
-    String ID = "ObjectId";
+    String ID = "cmis:ObjectId";
 
-    String URI = "Uri";
+    String URI = "cmis:Uri";
 
-    String TYPE_ID = "ObjectTypeId";
+    String TYPE_ID = "cmis:ObjectTypeId";
 
-    String BASE_TYPE_ID = "BaseTypeId";
+    String BASE_TYPE_ID = "cmis:BaseTypeId";
 
-    String CREATED_BY = "CreatedBy";
+    String CREATED_BY = "cmis:CreatedBy";
 
-    String CREATION_DATE = "CreationDate";
+    String CREATION_DATE = "cmis:CreationDate";
 
-    String LAST_MODIFIED_BY = "LastModifiedBy";
+    String LAST_MODIFIED_BY = "cmis:LastModifiedBy";
 
-    String LAST_MODIFICATION_DATE = "LastModificationDate";
+    String LAST_MODIFICATION_DATE = "cmis:LastModificationDate";
 
-    String CHANGE_TOKEN = "ChangeToken";
+    String CHANGE_TOKEN = "cmis:ChangeToken";
 
     /*
      * ----- Document -----
      */
 
-    String NAME = "Name";
+    String NAME = "cmis:Name";
 
-    String IS_IMMUTABLE = "IsImmutable";
+    String IS_IMMUTABLE = "cmis:IsImmutable";
 
-    String IS_LATEST_VERSION = "IsLatestVersion";
+    String IS_LATEST_VERSION = "cmis:IsLatestVersion";
 
-    String IS_MAJOR_VERSION = "IsMajorVersion";
+    String IS_MAJOR_VERSION = "cmis:IsMajorVersion";
 
-    String IS_LATEST_MAJOR_VERSION = "IsLatestMajorVersion";
+    String IS_LATEST_MAJOR_VERSION = "cmis:IsLatestMajorVersion";
 
-    String VERSION_LABEL = "VersionLabel";
+    String VERSION_LABEL = "cmis:VersionLabel";
 
-    String VERSION_SERIES_ID = "VersionSeriesId";
+    String VERSION_SERIES_ID = "cmis:VersionSeriesId";
 
-    String IS_VERSION_SERIES_CHECKED_OUT = "IsVersionSeriesCheckedOut";
+    String IS_VERSION_SERIES_CHECKED_OUT = "cmis:IsVersionSeriesCheckedOut";
 
-    String VERSION_SERIES_CHECKED_OUT_BY = "VersionSeriesCheckedOutBy";
+    String VERSION_SERIES_CHECKED_OUT_BY = "cmis:VersionSeriesCheckedOutBy";
 
-    String VERSION_SERIES_CHECKED_OUT_ID = "VersionSeriesCheckedOutId";
+    String VERSION_SERIES_CHECKED_OUT_ID = "cmis:VersionSeriesCheckedOutId";
 
-    String CHECKIN_COMMENT = "CheckinComment";
+    String CHECKIN_COMMENT = "cmis:CheckinComment";
 
-    String CONTENT_STREAM_LENGTH = "ContentStreamLength";
+    String CONTENT_STREAM_LENGTH = "cmis:ContentStreamLength";
 
-    String CONTENT_STREAM_MIME_TYPE = "ContentStreamMimeType";
+    String CONTENT_STREAM_MIME_TYPE = "cmis:ContentStreamMimeType";
 
-    String CONTENT_STREAM_FILENAME = "ContentStreamFilename";
+    String CONTENT_STREAM_FILENAME = "cmis:ContentStreamFilename";
 
-    String CONTENT_STREAM_URI = "ContentStreamUri";
+    String CONTENT_STREAM_URI = "cmis:ContentStreamUri";
 
     /*
      * ----- Folder -----
      */
 
     // NAME as well
-    String PARENT_ID = "ParentId";
+    String PARENT_ID = "cmis:ParentId";
 
-    String ALLOWED_CHILD_OBJECT_TYPE_IDS = "AllowedChildObjectTypeIds";
+    String ALLOWED_CHILD_OBJECT_TYPE_IDS = "cmis:AllowedChildObjectTypeIds";
 
     /*
      * ----- Relationship -----
      */
 
-    String SOURCE_ID = "SourceId";
+    String SOURCE_ID = "cmis:SourceId";
 
-    String TARGET_ID = "TargetId";
+    String TARGET_ID = "cmis:TargetId";
 
     /*
      * ----- Policy -----
      */
 
-    String POLICY_NAME = "PolicyName";
+    String POLICY_NAME = "cmis:PolicyName";
 
-    String POLICY_TEXT = "PolicyText";
+    String POLICY_TEXT = "cmis:PolicyText";
 
     /**
      * The property definition.

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
Wed Jul 22 19:35:08 2009
@@ -65,7 +65,7 @@
         case RELATIONSHIP:
             // return new APPRelationship(entry, type);
         default:
-            throw new AssertionError(entry.getBaseType().toString());
+            throw new AssertionError(entry.getBaseType().getId());
         }
     }
 

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=796853&r1=796852&r2=796853&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
Wed Jul 22 19:35:08 2009
@@ -94,8 +94,8 @@
                     }
                     if (name.equals(CMIS.BASE_TYPE_ID.getLocalPart())) {
                         // check base type coherent with base element
-                        // eg "folder" for a <cmis:folderType>
-                        if (!localName.startsWith(text)) {
+                        // eg "cmis:folder" for a <cmis:folderType>
+                        if (!("cmis:" + localName).startsWith(text)) {
                             throw new IllegalArgumentException(
                                     String.format(
                                             "Type element <cmis:%s> cannot have base
type: %s",

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/resources/feed-types.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/resources/feed-types.xml?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/resources/feed-types.xml
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/resources/feed-types.xml
Wed Jul 22 19:35:08 2009
@@ -15,10 +15,10 @@
     <link href="http://127.0.0.1:8080/cmis/type/document" rel="alternate" />
     <link href="http://127.0.0.1:8080/cmis/repository" rel="repository" />
     <cmis:documentType>
-      <cmis:id>document</cmis:id>
+      <cmis:id>cmis:document</cmis:id>
       <cmis:queryName>Document</cmis:queryName>
       <cmis:displayName>Document Type</cmis:displayName>
-      <cmis:baseTypeId>document</cmis:baseTypeId>
+      <cmis:baseTypeId>cmis:document</cmis:baseTypeId>
       <cmis:parentId />
       <cmis:description></cmis:description>
       <cmis:creatable>true</cmis:creatable>
@@ -38,10 +38,10 @@
     <link href="http://127.0.0.1:8080/cmis/type/folder" rel="alternate" />
     <link href="http://127.0.0.1:8080/cmis/repository" rel="repository" />
     <cmis:folderType>
-      <cmis:id>folder</cmis:id>
+      <cmis:id>cmis:folder</cmis:id>
       <cmis:queryName>Folder</cmis:queryName>
       <cmis:displayName>Folder Type</cmis:displayName>
-      <cmis:baseTypeId>folder</cmis:baseTypeId>
+      <cmis:baseTypeId>cmis:folder</cmis:baseTypeId>
       <cmis:parentId />
       <cmis:description></cmis:description>
       <cmis:creatable>true</cmis:creatable>
@@ -61,10 +61,10 @@
     <link href="http://127.0.0.1:8080/cmis/type/relationship" rel="alternate" />
     <link href="http://127.0.0.1:8080/cmis/repository" rel="repository" />
     <cmis:relationshipType>
-      <cmis:id>relationship</cmis:id>
+      <cmis:id>cmis:relationship</cmis:id>
       <cmis:queryName>Relationship</cmis:queryName>
       <cmis:displayName>Relationship Type</cmis:displayName>
-      <cmis:baseTypeId>relationship</cmis:baseTypeId>
+      <cmis:baseTypeId>cmis:relationship</cmis:baseTypeId>
       <cmis:parentId />
       <cmis:description></cmis:description>
       <cmis:creatable>true</cmis:creatable>
@@ -84,10 +84,10 @@
     <link href="http://127.0.0.1:8080/cmis/type/policy" rel="alternate" />
     <link href="http://127.0.0.1:8080/cmis/repository" rel="repository" />
     <cmis:policyType>
-      <cmis:id>policy</cmis:id>
+      <cmis:id>cmis:policy</cmis:id>
       <cmis:queryName>Policy</cmis:queryName>
       <cmis:displayName>Policy Type</cmis:displayName>
-      <cmis:baseTypeId>policy</cmis:baseTypeId>
+      <cmis:baseTypeId>cmis:policy</cmis:baseTypeId>
       <cmis:parentId />
       <cmis:description></cmis:description>
       <cmis:creatable>true</cmis:creatable>
@@ -110,8 +110,8 @@
       <cmis:id>Root</cmis:id>
       <cmis:queryName>Root</cmis:queryName>
       <cmis:displayName>Root Folder Type</cmis:displayName>
-      <cmis:baseTypeId>folder</cmis:baseTypeId>
-      <cmis:parentId>folder</cmis:parentId>
+      <cmis:baseTypeId>cmis:folder</cmis:baseTypeId>
+      <cmis:parentId>cmis:folder</cmis:parentId>
       <cmis:description></cmis:description>
       <cmis:creatable>false</cmis:creatable>
       <cmis:fileable>false</cmis:fileable>

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=796853&r1=796852&r2=796853&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
Wed Jul 22 19:35:08 2009
@@ -122,7 +122,7 @@
             typeElementQName = CMIS.POLICY_TYPE;
             break;
         default:
-            throw new AssertionError(type.getBaseType().toString());
+            throw new AssertionError(type.getBaseType().getId());
         }
         Element dt = factory.newElement(typeElementQName, entry);
         Element el;
@@ -136,7 +136,7 @@
         el = factory.newElement(CMIS.DISPLAY_NAME, dt);
         el.setText(type.getDisplayName());
         el = factory.newElement(CMIS.BASE_TYPE_ID, dt);
-        el.setText(type.getBaseType().toString());
+        el.setText(type.getBaseType().getId());
         el = factory.newElement(CMIS.PARENT_ID, dt);
         el.setText(type.getParentId());
         el = factory.newElement(CMIS.DESCRIPTION, dt);

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=796853&r1=796852&r2=796853&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
Wed Jul 22 19:35:08 2009
@@ -104,14 +104,14 @@
                 "def:date", "Date", "", false, PropertyType.DATETIME, false,
                 null, false, false, null, Updatability.READ_WRITE, true, true,
                 0, null, null, -1, null);
-        SimpleType dt = new SimpleType("doc", "document", "Doc", "My Doc Type",
-                BaseType.DOCUMENT, "", true, true, true, true, true, true,
-                ContentStreamPresence.ALLOWED, null, null, Arrays.asList(p1,
-                        p2, p3));
-        SimpleType ft = new SimpleType("fold", "folder", "Fold",
-                "My Folder Type", BaseType.FOLDER, "", true, true, true, true,
-                false, false, ContentStreamPresence.NOT_ALLOWED, null, null,
-                Arrays.asList(p1, p2));
+        SimpleType dt = new SimpleType("doc", BaseType.DOCUMENT.getId(),
+                "Doc", "My Doc Type", BaseType.DOCUMENT, "", true, true, true,
+                true, true, true, ContentStreamPresence.ALLOWED, null, null,
+                Arrays.asList(p1, p2, p3));
+        SimpleType ft = new SimpleType("fold", BaseType.FOLDER.getId(),
+                "Fold", "My Folder Type", BaseType.FOLDER, "", true, true,
+                true, true, false, false, ContentStreamPresence.NOT_ALLOWED,
+                null, null, Arrays.asList(p1, p2));
         SimpleRepository repo = new SimpleRepository("test", Arrays.asList(dt,
                 ft), rootId);
         Connection conn = repo.getConnection(null);
@@ -152,7 +152,8 @@
     }
 
     public void testConnect() throws Exception {
-        String base = "http://localhost:" + PORT + CONTEXT_PATH + SERVLET_PATH + getResourcePath();
+        String base = "http://localhost:" + PORT + CONTEXT_PATH + SERVLET_PATH
+                + getResourcePath();
         ClientResponse resp;
 
         resp = client.get(base + "/repository");

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=796853&r1=796852&r2=796853&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
Wed Jul 22 19:35:08 2009
@@ -169,7 +169,7 @@
                 el.setAttributeValue(CMIS.NAME, "BaseType");
                 Element val = el.addExtension(CMIS.VALUE);
                 // don't merge these two lines
-                val.setText(type.getBaseType().toString());
+                val.setText(type.getBaseType().getId());
             }
         }
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/pom.xml?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/pom.xml (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/pom.xml Wed Jul 22 19:35:08 2009
@@ -34,6 +34,10 @@
       <artifactId>chemistry-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+    </dependency>
+    <dependency>
       <groupId>stax</groupId>
       <artifactId>stax-api</artifactId>
     </dependency>

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/impl/simple/CmisSqlSimpleWalker.g
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/impl/simple/CmisSqlSimpleWalker.g?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/impl/simple/CmisSqlSimpleWalker.g
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/antlr3/org/apache/chemistry/impl/simple/CmisSqlSimpleWalker.g
Wed Jul 22 19:35:08 2009
@@ -89,6 +89,7 @@
     ^(COL qualifier? column_name)
       {
           String col = $column_name.start.getText();
+          // TODO should use query name
           $value = data.get(col); // TODO error if unknown prop
       }
     ;

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=796853&r1=796852&r2=796853&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
Wed Jul 22 19:35:08 2009
@@ -45,42 +45,37 @@
     // from the spec
     public static final String ROOT_FOLDER_NAME = "CMIS_Root_Folder";
 
-    public static final String ROOT_TYPE_ID = "Root";
-
-    public static final String DOCUMENT_TYPE_ID = "document";
-
-    public static final String FOLDER_TYPE_ID = "folder";
-
-    public static final String RELATIONSHIP_TYPE_ID = "relationship";
-
-    public static final String POLICY_TYPE_ID = "policy";
+    public static final String ROOT_TYPE_ID = "chemistry:root";
 
     public static final SimpleType ROOT_TYPE = new SimpleType(ROOT_TYPE_ID,
-            FOLDER_TYPE_ID, "Root", "Root Folder Type", BaseType.FOLDER, "",
-            false, false, false, false, false, false,
+            BaseType.FOLDER.getId(), ROOT_TYPE_ID, "Root Folder Type",
+            BaseType.FOLDER, "", false, false, false, false, false, false,
             ContentStreamPresence.NOT_ALLOWED, null, null,
             Collections.<PropertyDefinition> emptyList());
 
-    public static final SimpleType DOCUMENT_TYPE = new SimpleType(DOCUMENT_TYPE_ID,
-            null, "Document", "Document Type", BaseType.DOCUMENT, "", true,
-            true, true, true, true, true, ContentStreamPresence.ALLOWED, null,
-            null, Collections.<PropertyDefinition> emptyList());
-
-    public static final SimpleType FOLDER_TYPE = new SimpleType(FOLDER_TYPE_ID, null,
-            "Folder", "Folder Type", BaseType.FOLDER, "", true, true, false,
-            true, true, false, ContentStreamPresence.NOT_ALLOWED, null, null,
+    public static final SimpleType DOCUMENT_TYPE = new SimpleType(
+            BaseType.DOCUMENT.getId(), null, BaseType.DOCUMENT.getId(),
+            "Document Type", BaseType.DOCUMENT, "", true, true, true, true,
+            true, true, ContentStreamPresence.ALLOWED, null, null,
+            Collections.<PropertyDefinition> emptyList());
+
+    public static final SimpleType FOLDER_TYPE = new SimpleType(
+            BaseType.FOLDER.getId(), null, BaseType.FOLDER.getId(),
+            "Folder Type", BaseType.FOLDER, "", true, true, false, true, true,
+            false, ContentStreamPresence.NOT_ALLOWED, null, null,
             Collections.<PropertyDefinition> emptyList());
 
     public static final SimpleType RELATIONSHIP_TYPE = new SimpleType(
-            RELATIONSHIP_TYPE_ID, null, "Relationship", "Relationship Type",
-            BaseType.RELATIONSHIP, "", true, true, false, true, false, false,
-            ContentStreamPresence.NOT_ALLOWED, null, null,
+            BaseType.RELATIONSHIP.getId(), null, BaseType.RELATIONSHIP.getId(),
+            "Relationship Type", BaseType.RELATIONSHIP, "", true, true, false,
+            true, false, false, ContentStreamPresence.NOT_ALLOWED, null, null,
             Collections.<PropertyDefinition> emptyList());
 
-    protected static final SimpleType POLICY_TYPE = new SimpleType(POLICY_TYPE_ID,
-            null, "Policy", "Policy Type", BaseType.POLICY, "", true, true,
-            false, true, false, false, ContentStreamPresence.NOT_ALLOWED, null,
-            null, Collections.<PropertyDefinition> emptyList());
+    protected static final SimpleType POLICY_TYPE = new SimpleType(
+            BaseType.POLICY.getId(), null, "Policy", "Policy Type",
+            BaseType.POLICY, "", true, true, false, true, false, false,
+            ContentStreamPresence.NOT_ALLOWED, null, null,
+            Collections.<PropertyDefinition> emptyList());
 
     protected final Map<String, Type> types = new HashMap<String, Type>();
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleData.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleData.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleData.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleData.java
Wed Jul 22 19:35:08 2009
@@ -34,7 +34,7 @@
 
     public SimpleData(String typeId, BaseType baseType) {
         put(Property.TYPE_ID, typeId);
-        put(Property.BASE_TYPE_ID, baseType.toString());
+        put(Property.BASE_TYPE_ID, baseType.getId());
     }
 
 }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/test/java/org/apache/chemistry/impl/simple/TestSimpleRepository.java
Wed Jul 22 19:35:08 2009
@@ -61,14 +61,14 @@
                 "def:date", "Date", "", false, PropertyType.DATETIME, false,
                 null, false, false, null, Updatability.READ_WRITE, true, true,
                 0, null, null, -1, null);
-        SimpleType mt1 = new SimpleType("doc", null, "Doc", "My Doc Type",
-                BaseType.DOCUMENT, "", true, true, true, true, true, true,
-                ContentStreamPresence.ALLOWED, null, null, Arrays.asList(d1,
-                        d2, d3));
-        SimpleType mt2 = new SimpleType("fold", null, "Fold", "My Folder Type",
-                BaseType.FOLDER, "", true, true, true, true, false, false,
-                ContentStreamPresence.NOT_ALLOWED, null, null, Arrays.asList(
-                        d1, d2));
+        SimpleType mt1 = new SimpleType("doc", BaseType.DOCUMENT.getId(),
+                "Doc", "My Doc Type", BaseType.DOCUMENT, "", true, true, true,
+                true, true, true, ContentStreamPresence.ALLOWED, null, null,
+                Arrays.asList(d1, d2, d3));
+        SimpleType mt2 = new SimpleType("fold", BaseType.FOLDER.getId(),
+                "Fold", "My Folder Type", BaseType.FOLDER, "", true, true,
+                true, true, false, false, ContentStreamPresence.NOT_ALLOWED,
+                null, null, Arrays.asList(d1, d2));
         repo = new SimpleRepository("test", Arrays.asList(mt1, mt2), null);
 
     }
@@ -221,18 +221,22 @@
         Document d1 = root.newDocument("doc");
         d1.save();
 
-        Collection<CMISObject> res = conn.query("SELECT * FROM Folder", false);
+        Collection<CMISObject> res = conn.query("SELECT * FROM cmis:folder",
+                false);
         assertEquals(1, res.size()); // the root
         res = conn.query("SELECT * FROM fold", false);
         assertEquals(0, res.size());
         res = conn.query("SELECT * FROM doc", false);
         assertEquals(1, res.size());
-        res = conn.query("SELECT * FROM Folder WHERE Name = 'CMIS_Root_Folder'",
+        res = conn.query(
+                "SELECT * FROM cmis:folder WHERE cmis:Name = 'CMIS_Root_Folder'",
                 false);
         assertEquals(1, res.size());
-        res = conn.query("SELECT * FROM doc WHERE ObjectId = 'nosuchid'", false);
+        res = conn.query("SELECT * FROM doc WHERE cmis:ObjectId = 'nosuchid'",
+                false);
         assertEquals(0, res.size());
-        res = conn.query("SELECT * FROM doc WHERE ObjectId <> '123'", false);
+        res = conn.query("SELECT * FROM doc WHERE cmis:ObjectId <> '123'",
+                false);
         assertEquals(1, res.size());
     }
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/pom.xml?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/pom.xml (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/pom.xml Wed Jul 22 19:35:08 2009
@@ -49,7 +49,6 @@
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
-      <version>1.1</version>
     </dependency>
 
     <dependency>

Modified: incubator/chemistry/trunk/chemistry/chemistry-parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-parent/pom.xml?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-parent/pom.xml (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-parent/pom.xml Wed Jul 22 19:35:08 2009
@@ -152,6 +152,11 @@
         <version>3.1</version>
       </dependency>
       <dependency>
+        <groupId>commons-logging</groupId>
+        <artifactId>commons-logging</artifactId>
+        <version>1.1.1</version>
+      </dependency>
+      <dependency>
         <groupId>stax</groupId>
         <artifactId>stax-api</artifactId>
         <version>1.0.1</version>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tests/pom.xml
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tests/pom.xml?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tests/pom.xml (original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tests/pom.xml Wed Jul 22 19:35:08 2009
@@ -51,8 +51,6 @@
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
-      <version>1.1</version>
-      <scope>compile</scope> <!-- override -->
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>

Modified: incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicHelper.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicHelper.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicHelper.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicHelper.java
Wed Jul 22 19:35:08 2009
@@ -59,14 +59,14 @@
                 "def:date", "Date", "", false, PropertyType.DATETIME, false,
                 null, false, false, null, Updatability.READ_WRITE, true, true,
                 0, null, null, -1, null);
-        SimpleType dt = new SimpleType("doc", "document", "Doc", "My Doc Type",
-                BaseType.DOCUMENT, "", true, true, true, true, true, true,
-                ContentStreamPresence.ALLOWED, null, null, Arrays.asList(p1,
-                        p2, p3));
-        SimpleType ft = new SimpleType("fold", "folder", "Fold",
-                "My Folder Type", BaseType.FOLDER, "", true, true, true, true,
-                false, false, ContentStreamPresence.NOT_ALLOWED, null, null,
-                Arrays.asList(p1, p2));
+        SimpleType dt = new SimpleType("doc", BaseType.DOCUMENT.getId(),
+                "Doc", "My Doc Type", BaseType.DOCUMENT, "", true, true, true,
+                true, true, true, ContentStreamPresence.ALLOWED, null, null,
+                Arrays.asList(p1, p2, p3));
+        SimpleType ft = new SimpleType("fold", BaseType.FOLDER.getId(),
+                "Fold", "My Folder Type", BaseType.FOLDER, "", true, true,
+                true, true, false, false, ContentStreamPresence.NOT_ALLOWED,
+                null, null, Arrays.asList(p1, p2));
         SimpleRepository repo = new SimpleRepository("test", Arrays.asList(dt,
                 ft), rootId);
         Connection conn = repo.getConnection(null);

Modified: incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tests/src/main/java/org/apache/chemistry/test/BasicTestCase.java
Wed Jul 22 19:35:08 2009
@@ -48,7 +48,7 @@
  */
 public abstract class BasicTestCase extends TestCase {
 
-    public static final String ROOT_TYPE_ID = "Root"; // not in the spec
+    public static final String ROOT_TYPE_ID = "chemistry:root"; // not in the spec
 
     public Repository repository;
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-tests/src/test/java/org/apache/chemistry/test/TestAtomPubClientServer.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-tests/src/test/java/org/apache/chemistry/test/TestAtomPubClientServer.java?rev=796853&r1=796852&r2=796853&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-tests/src/test/java/org/apache/chemistry/test/TestAtomPubClientServer.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-tests/src/test/java/org/apache/chemistry/test/TestAtomPubClientServer.java
Wed Jul 22 19:35:08 2009
@@ -67,8 +67,10 @@
 
     public void stopServer() throws Exception {
         // Thread.sleep(60 * MINUTES);
-        server.stop();
-        log.info("CMIS server stopped");
+        if (server != null) {
+            server.stop();
+            log.info("CMIS server stopped");
+        }
     }
 
     @Override
@@ -79,6 +81,16 @@
     }
 
     @Override
+    public void setUp() throws Exception {
+        try {
+            super.setUp();
+        } catch (Exception e) {
+            stopServer();
+            throw e;
+        }
+    }
+
+    @Override
     public void tearDown() throws Exception {
         super.tearDown();
         stopServer();



Mime
View raw message