chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r960633 - /incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
Date Mon, 05 Jul 2010 16:35:17 GMT
Author: fmui
Date: Mon Jul  5 16:35:16 2010
New Revision: 960633

URL: http://svn.apache.org/viewvc?rev=960633&view=rev
Log:
- workaround for Chemistry server bug

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java?rev=960633&r1=960632&r2=960633&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
Mon Jul  5 16:35:16 2010
@@ -38,6 +38,7 @@ import org.apache.chemistry.opencmis.cli
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.AtomLink;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.RepositoryWorkspace;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.objects.ServiceDoc;
+import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
 import org.apache.chemistry.opencmis.commons.impl.Constants;
 import org.apache.chemistry.opencmis.commons.impl.JaxBHelper;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisAccessControlListType;
@@ -47,6 +48,10 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisPropertyId;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisRepositoryInfoType;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisTypeDefinitionType;
+import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisTypeDocumentDefinitionType;
+import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisTypeFolderDefinitionType;
+import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisTypePolicyDefinitionType;
+import org.apache.chemistry.opencmis.commons.impl.jaxb.CmisTypeRelationshipDefinitionType;
 import org.apache.chemistry.opencmis.commons.impl.jaxb.EnumPropertiesBase;
 
 /**
@@ -305,7 +310,17 @@ public class AtomPubParser implements Cm
                     || TAG_RELATIVE_PATH_SEGMENT.equals(name.getLocalPart())) {
                 return parseText(parser);
             } else if (TAG_TYPE.equals(name.getLocalPart())) {
-                return unmarshalElement(parser, CmisTypeDefinitionType.class);
+                String typeAttr = parser.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance",
"type");
+                if (typeAttr.endsWith("cmisTypeDocumentDefinitionType")) {
+                    return unmarshalElement(parser, CmisTypeDocumentDefinitionType.class);
+                } else if (typeAttr.endsWith("cmisTypeFolderDefinitionType")) {
+                    return unmarshalElement(parser, CmisTypeFolderDefinitionType.class);
+                } else if (typeAttr.endsWith("cmisTypeRelationshipDefinitionType")) {
+                    return unmarshalElement(parser, CmisTypeRelationshipDefinitionType.class);
+                } else if (typeAttr.endsWith("cmisTypePolicyDefinitionType")) {
+                    return unmarshalElement(parser, CmisTypePolicyDefinitionType.class);
+                }
+                throw new CmisRuntimeException("Cannot read type definition!");
             } else if (TAG_CHILDREN.equals(name.getLocalPart())) {
                 return parseChildren(parser);
             }



Mime
View raw message