chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r901008 - in /incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src: main/java/org/apache/chemistry/atompub/client/ main/java/org/apache/chemistry/atompub/client/connector/ test/java/org/apache/chemistry/atompub/client/
Date Tue, 19 Jan 2010 23:59:08 GMT
Author: fguillaume
Date: Tue Jan 19 23:59:06 2010
New Revision: 901008

URL: http://svn.apache.org/viewvc?rev=901008&view=rev
Log:
Fix loading of types without any property definitions

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObjectEntry.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepository.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPType.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/main/java/org/apache/chemistry/atompub/client/TypeFeedReader.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Connector.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/DefaultIOProvider.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientConnector.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientResponse.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/IOProvider.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Response.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/TypeFeedReaderTest.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObjectEntry.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObjectEntry.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObjectEntry.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObjectEntry.java
Tue Jan 19 23:59:06 2010
@@ -53,6 +53,8 @@
     protected static final ContentStream REMOTE_CONTENT_STREAM = new SimpleContentStream(
             new byte[0], null, null);
 
+    protected final APPRepository repository;
+
     protected final APPConnection connection;
 
     protected final Map<String, XmlProperty> properties;
@@ -102,9 +104,10 @@
         }
     }
 
-    public APPObjectEntry(APPConnection connection,
+    protected APPObjectEntry(APPRepository repository, APPConnection connection,
             Map<String, XmlProperty> properties,
             Map<QName, Boolean> allowableActions) {
+        this.repository = repository;
         this.connection = connection;
         this.properties = properties;
         if (allowableActions == null) {
@@ -116,6 +119,17 @@
         links = new ArrayList<Link>();
     }
 
+    public APPObjectEntry(APPConnection connection,
+            Map<String, XmlProperty> properties,
+            Map<QName, Boolean> allowableActions) {
+        this((APPRepository) connection.getRepository(), connection,
+                properties, allowableActions);
+    }
+
+    public APPObjectEntry(APPRepository repository) {
+        this(repository, null, new HashMap<String, XmlProperty>(), null);
+    }
+
     public void addContentHref(String href, String type) {
         remoteContentHref = href;
         remoteContentType = type;
@@ -163,10 +177,6 @@
 
     // -----
 
-    public APPConnection getConnection() {
-        return connection;
-    }
-
     protected boolean isCreation() {
         return getId() == null;
     }
@@ -220,8 +230,8 @@
         if (p != null) {
             p.setValue(value);
         } else {
-            PropertyDefinition pd = connection.getRepository().getType(
-                    getTypeId()).getPropertyDefinition(id);
+            PropertyDefinition pd = repository.getType(getTypeId()).getPropertyDefinition(
+                    id);
             if (pd == null) {
                 throw new IllegalArgumentException("No such property: " + id);
             }
@@ -236,8 +246,8 @@
         if (p != null) {
             p._setValue(value);
         } else {
-            PropertyDefinition pd = connection.getRepository().getType(
-                    getTypeId()).getPropertyDefinition(id);
+            PropertyDefinition pd = repository.getType(getTypeId()).getPropertyDefinition(
+                    id);
             if (pd == null) {
                 throw new IllegalArgumentException("No such property: " + id);
             }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepository.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepository.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepository.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPRepository.java
Tue Jan 19 23:59:06 2010
@@ -17,7 +17,6 @@
  */
 package org.apache.chemistry.atompub.client;
 
-import java.io.InputStream;
 import java.io.Serializable;
 import java.net.URI;
 import java.util.Collection;
@@ -38,8 +37,6 @@
 import org.apache.chemistry.atompub.AtomPubCMIS;
 import org.apache.chemistry.atompub.URITemplate;
 import org.apache.chemistry.atompub.client.connector.APPContentManager;
-import org.apache.chemistry.atompub.client.connector.Request;
-import org.apache.chemistry.atompub.client.connector.Response;
 import org.apache.chemistry.atompub.client.stax.ReadContext;
 import org.apache.chemistry.impl.simple.SimpleTypeManager;
 import org.apache.commons.logging.Log;
@@ -77,7 +74,7 @@
         this.info = info;
     }
 
-    public ContentManager getContentManager() {
+    public APPContentManager getContentManager() {
         return cm;
     }
 
@@ -211,20 +208,17 @@
     }
 
     protected TypeManager readTypes(String href) throws Exception {
-        // TODO lazy load property definition
-        Request req = new Request(href + "?includePropertyDefinitions=true");
-        Response resp = cm.getConnector().get(req);
-        if (!resp.isOk()) {
-            throw new ContentManagerException(
-                    "Remote server returned error code: "
-                            + resp.getStatusCode());
-        }
-        InputStream in = resp.getStream();
-        try {
-            return TypeFeedReader.INSTANCE.read(new ReadContext(this), in);
-        } finally {
-            in.close();
+        href = includePropertyDefinitionsInURI(href);
+        return cm.getConnector().getTypeFeed(new ReadContext(this), href, true);
+    }
+
+    protected static String includePropertyDefinitionsInURI(String href) {
+        if (!href.contains(AtomPubCMIS.PARAM_INCLUDE_PROPERTY_DEFINITIONS)) {
+            char sep = href.contains("?") ? '&' : '?';
+            href += sep + AtomPubCMIS.PARAM_INCLUDE_PROPERTY_DEFINITIONS
+                    + "=true";
         }
+        return href;
     }
 
     /*

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPType.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPType.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPType.java
Tue Jan 19 23:59:06 2010
@@ -29,8 +29,8 @@
 import org.apache.chemistry.ContentStreamPresence;
 import org.apache.chemistry.PropertyDefinition;
 import org.apache.chemistry.Type;
+import org.apache.chemistry.atompub.client.connector.Connector;
 import org.apache.chemistry.atompub.client.stax.ReadContext;
-import org.apache.chemistry.atompub.client.stax.XmlProperty;
 
 /**
  *
@@ -45,10 +45,11 @@
 
     protected String parentId = UNDEFINED;
 
+    /** Property definitions. {@code null} when not yet loaded (lazy). */
     protected Map<String, PropertyDefinition> propertyDefs;
 
-    public APPType(APPConnection connection) {
-        super(connection, new HashMap<String, XmlProperty>(), null);
+    public APPType(APPRepository repository) {
+        super(repository);
     }
 
     public void init(Map<String, String> properties,
@@ -175,9 +176,12 @@
 
     protected void loadPropertyDef() {
         if (propertyDefs == null) {
-            APPType typeDef = (APPType) connection.getConnector().getType(
-                    new ReadContext(connection), getEditLink());
-            propertyDefs = typeDef.propertyDefs;
+            Connector connector = repository.getContentManager().getConnector();
+            String href = APPRepository.includePropertyDefinitionsInURI(getEditLink());
+            APPType typeDef = (APPType) connector.getType(new ReadContext(
+                    repository), href, true);
+            propertyDefs = typeDef.propertyDefs == null ? new HashMap<String, PropertyDefinition>()
+                    : typeDef.propertyDefs;
         }
     }
 

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=901008&r1=901007&r2=901008&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 Jan 19 23:59:06 2010
@@ -43,11 +43,15 @@
 
     private static final Log log = LogFactory.getLog(TypeEntryReader.class);
 
-    public static final TypeEntryReader INSTANCE = new TypeEntryReader();
+    protected final boolean includePropertyDefinitions;
+
+    public TypeEntryReader(boolean includePropertyDefinitions) {
+        this.includePropertyDefinitions = includePropertyDefinitions;
+    }
 
     @Override
     protected APPType createObject(ReadContext ctx) {
-        APPType type = new APPType((APPConnection) ctx.getConnection());
+        APPType type = new APPType((APPRepository) ctx.getRepository());
         return type;
     }
 
@@ -69,19 +73,18 @@
         if (AtomPubCMIS.TYPE.getLocalPart().equals(reader.getLocalName())) {
             ChildrenNavigator children = reader.getChildren();
             Map<String, String> map = new HashMap<String, String>();
-            Map<String, PropertyDefinition> pdefs = null;
+            Map<String, PropertyDefinition> pdefs = new HashMap<String, PropertyDefinition>();
             while (children.next()) {
                 String name = reader.getLocalName();
                 if (name.startsWith("property")) {
-                    if (pdefs == null) {
-                        pdefs = new HashMap<String, PropertyDefinition>();
+                    if (includePropertyDefinitions) {
+                        PropertyDefinition pdef = readPropertyDef(reader);
+                        if (pdef.getId() == null) {
+                            throw new IllegalArgumentException(
+                                    "Invalid property definition: no id given");
+                        }
+                        pdefs.put(pdef.getId(), pdef);
                     }
-                    PropertyDefinition pdef = readPropertyDef(reader);
-                    if (pdef.getId() == null) {
-                        throw new IllegalArgumentException(
-                                "Invalid property definition: no id given");
-                    }
-                    pdefs.put(pdef.getId(), pdef);
                 } else {
                     String text;
                     try {
@@ -122,6 +125,9 @@
                             + qname.getPrefix() + ':' + qname.getLocalPart());
                 }
             }
+            if (!includePropertyDefinitions) {
+                pdefs = null;
+            }
             entry.init(map, pdefs);
         }
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeFeedReader.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeFeedReader.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeFeedReader.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/TypeFeedReader.java
Tue Jan 19 23:59:06 2010
@@ -27,14 +27,8 @@
  */
 public class TypeFeedReader extends AbstractFeedReader<TypeManager, APPType> {
 
-    public static final TypeFeedReader INSTANCE = new TypeFeedReader();
-
-    public TypeFeedReader() {
-        super(TypeEntryReader.INSTANCE);
-    }
-
-    public TypeFeedReader(TypeEntryReader entryReader) {
-        super(entryReader);
+    public TypeFeedReader(boolean includePropertyDefinitions) {
+        super(new TypeEntryReader(includePropertyDefinitions));
     }
 
     @Override

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Connector.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Connector.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Connector.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Connector.java
Tue Jan 19 23:59:06 2010
@@ -24,6 +24,7 @@
 import org.apache.chemistry.Paging;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.Type;
+import org.apache.chemistry.TypeManager;
 import org.apache.chemistry.atompub.client.ContentManagerException;
 import org.apache.chemistry.atompub.client.stax.ReadContext;
 import org.apache.chemistry.atompub.client.stax.XmlObjectWriter;
@@ -51,7 +52,8 @@
 
     Response delete(Request operation) throws ContentManagerException;
 
-    Type getType(ReadContext ctx, String href) throws ContentManagerException;
+    Type getType(ReadContext ctx, String href,
+            boolean includePropertyDefinitions) throws ContentManagerException;
 
     ObjectEntry getObject(ReadContext ctx, String href)
             throws ContentManagerException;
@@ -59,8 +61,8 @@
     List<ObjectEntry> getObjectFeed(ReadContext ctx, String href)
             throws ContentManagerException;
 
-    List<ObjectEntry> getTypeFeed(ReadContext ctx, String href)
-            throws ContentManagerException;
+    TypeManager getTypeFeed(ReadContext ctx, String href,
+            boolean includePropertyDefinitions) throws ContentManagerException;
 
     Repository[] getServiceDocument(ReadContext ctx, String href)
             throws ContentManagerException;

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/DefaultIOProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/DefaultIOProvider.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/DefaultIOProvider.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/DefaultIOProvider.java
Tue Jan 19 23:59:06 2010
@@ -46,10 +46,6 @@
     protected final APPObjectFeedReader objectFeedReader = new APPObjectFeedReader(
             objectReader);
 
-    protected final TypeEntryReader typeReader = new TypeEntryReader();
-
-    protected final TypeFeedReader typeFeedReader = new TypeFeedReader(typeReader);
-
     protected final APPServiceDocumentReader serviceDocumentReader = new APPServiceDocumentReader();
 
     protected final APPObjectEntryWriter objectWriter = new APPObjectEntryWriter();
@@ -66,12 +62,12 @@
         return serviceDocumentReader;
     }
 
-    public FeedReader<TypeManager> getTypeFeedReader() {
-        return typeFeedReader;
+    public FeedReader<TypeManager> getTypeFeedReader(boolean includePropertyDefinitions)
{
+        return new TypeFeedReader(includePropertyDefinitions);
     }
 
-    public EntryReader<? extends Type> getTypeEntryReader() {
-        return typeReader;
+    public EntryReader<? extends Type> getTypeEntryReader(boolean includePropertyDefinitions)
{
+        return new TypeEntryReader(includePropertyDefinitions);
     }
 
     public XmlObjectWriter<ObjectEntry> getObjectEntryWriter() {

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientConnector.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientConnector.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientConnector.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientConnector.java
Tue Jan 19 23:59:06 2010
@@ -27,6 +27,7 @@
 import org.apache.chemistry.Paging;
 import org.apache.chemistry.Repository;
 import org.apache.chemistry.Type;
+import org.apache.chemistry.TypeManager;
 import org.apache.chemistry.atompub.client.ContentManagerException;
 import org.apache.chemistry.atompub.client.stax.ReadContext;
 import org.apache.chemistry.atompub.client.stax.XmlObjectWriter;
@@ -54,6 +55,10 @@
     public HttpClientConnector(IOProvider io) {
         this.io = io;
         client = new HttpClient();
+        // use a multi-threaded connection manager because we need reentrancy
+        // when reading some property definition
+        // client.setHttpConnectionManager(new
+        // MultiThreadedHttpConnectionManager());
     }
 
     public void setCredentialsProvider(CredentialsProvider cp) {
@@ -167,7 +172,8 @@
         }
     }
 
-    public Type getType(ReadContext ctx, String href) {
+    public Type getType(ReadContext ctx, String href,
+            boolean includePropertyDefinitions) {
         Request req = new Request(href);
         Response resp = get(req);
         if (!resp.isOk()) {
@@ -175,7 +181,7 @@
                     "Remote server returned error code: "
                             + resp.getStatusCode() + "\n\n" + resp.getString());
         }
-        return resp.getType(ctx);
+        return resp.getType(ctx, includePropertyDefinitions);
     }
 
     public ObjectEntry getObject(ReadContext ctx, String href) {
@@ -201,8 +207,8 @@
         return resp.getObjectFeed(ctx);
     }
 
-    public List<ObjectEntry> getTypeFeed(ReadContext ctx, String href)
-            throws ContentManagerException {
+    public TypeManager getTypeFeed(ReadContext ctx, String href,
+            boolean includePropertyDefinitions) throws ContentManagerException {
         Request req = new Request(href);
         Response resp = get(req);
         if (!resp.isOk()) {
@@ -210,7 +216,7 @@
                     "Remote server returned error code: "
                             + resp.getStatusCode() + "\n\n" + resp.getString());
         }
-        return resp.getObjectFeed(ctx);
+        return resp.getTypeFeed(ctx, includePropertyDefinitions);
     }
 
     public Repository[] getServiceDocument(ReadContext ctx, String href)

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientResponse.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientResponse.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientResponse.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/HttpClientResponse.java
Tue Jan 19 23:59:06 2010
@@ -132,18 +132,21 @@
         }
     }
 
-    public Type getType(ReadContext ctx) throws ContentManagerException {
+    public Type getType(ReadContext ctx, boolean includePropertyDefinitions)
+            throws ContentManagerException {
         try {
-            return io.getTypeEntryReader().read(ctx, getStream());
+            return io.getTypeEntryReader(includePropertyDefinitions).read(ctx,
+                    getStream());
         } catch (XMLStreamException e) {
             throw new ContentManagerException(e);
         }
     }
 
-    public TypeManager getTypeFeed(ReadContext ctx)
-            throws ContentManagerException {
+    public TypeManager getTypeFeed(ReadContext ctx,
+            boolean includePropertyDefinitions) throws ContentManagerException {
         try {
-            return io.getTypeFeedReader().read(ctx, getStream());
+            return io.getTypeFeedReader(includePropertyDefinitions).read(ctx,
+                    getStream());
         } catch (XMLStreamException e) {
             throw new ContentManagerException(e);
         }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/IOProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/IOProvider.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/IOProvider.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/IOProvider.java
Tue Jan 19 23:59:06 2010
@@ -36,13 +36,14 @@
 
     EntryReader<? extends ObjectEntry> getObjectEntryReader();
 
-    EntryReader<? extends Type> getTypeEntryReader();
+    EntryReader<? extends Type> getTypeEntryReader(
+            boolean includePropertyDefinitions);
 
     ServiceDocumentReader<?> getServiceDocumentReader();
 
     FeedReader<ListPage<ObjectEntry>> getObjectFeedReader();
 
-    FeedReader<TypeManager> getTypeFeedReader();
+    FeedReader<TypeManager> getTypeFeedReader(boolean includePropertyDefinitions);
 
     XmlObjectWriter<ObjectEntry> getObjectEntryWriter();
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Response.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Response.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Response.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/connector/Response.java
Tue Jan 19 23:59:06 2010
@@ -51,11 +51,13 @@
     ListPage<ObjectEntry> getObjectFeed(ReadContext ctx)
             throws ContentManagerException;
 
-    TypeManager getTypeFeed(ReadContext ctx) throws ContentManagerException;
+    TypeManager getTypeFeed(ReadContext ctx, boolean includePropertyDefinitions)
+            throws ContentManagerException;
 
     ObjectEntry getObject(ReadContext ctx) throws ContentManagerException;
 
-    Type getType(ReadContext ctx) throws ContentManagerException;
+    Type getType(ReadContext ctx, boolean includePropertyDefinitions)
+            throws ContentManagerException;
 
     Repository[] getServiceDocument(ReadContext ctx)
             throws ContentManagerException;

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/TypeFeedReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/TypeFeedReaderTest.java?rev=901008&r1=901007&r2=901008&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/TypeFeedReaderTest.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/test/java/org/apache/chemistry/atompub/client/TypeFeedReaderTest.java
Tue Jan 19 23:59:06 2010
@@ -29,8 +29,8 @@
 
     public void testReadTypesFeed() throws Exception {
         InputStream is = getClass().getResourceAsStream("/types-feed.xml");
-        TypeManager typeManager = TypeFeedReader.INSTANCE.read(new ReadContext(
-                (Repository) null), is);
+        TypeManager typeManager = new TypeFeedReader(true).read(
+                new ReadContext((Repository) null), is);
         assertEquals(5, typeManager.getTypes().size());
     }
 



Mime
View raw message