chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1059029 - in /incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub: CmisAtomPubServlet.java RepositoryService.java
Date Fri, 14 Jan 2011 14:55:29 GMT
Author: fmui
Date: Fri Jan 14 14:55:29 2011
New Revision: 1059029

URL: http://svn.apache.org/viewvc?rev=1059029&view=rev
Log:
CMIS 1.1 sandbox bug fixes

Modified:
    incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
    incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java

Modified: incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java?rev=1059029&r1=1059028&r2=1059029&view=diff
==============================================================================
--- incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
(original)
+++ incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/CmisAtomPubServlet.java
Fri Jan 14 14:55:29 2011
@@ -89,7 +89,7 @@ public class CmisAtomPubServlet extends 
                     "getTypeDescendants");
             dispatcher.addResource(AtomPubUtils.RESOURCE_TYPE, Dispatcher.METHOD_GET, RepositoryService.class,
                     "getTypeDefinition");
-            dispatcher.addResource(AtomPubUtils.RESOURCE_TYPES, Dispatcher.METHOD_POST, RepositoryService.class,
+            dispatcher.addResource(AtomPubUtils.RESOURCE_TYPE, Dispatcher.METHOD_POST, RepositoryService.class,
                     "createTypeDefinition");
             dispatcher.addResource(AtomPubUtils.RESOURCE_TYPE, Dispatcher.METHOD_PUT, RepositoryService.class,
                     "updateTypeDefinition");

Modified: incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java?rev=1059029&r1=1059028&r2=1059029&view=diff
==============================================================================
--- incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
(original)
+++ incubator/chemistry/opencmis-cmis11/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
Fri Jan 14 14:55:29 2011
@@ -422,11 +422,11 @@ public final class RepositoryService {
     public static void createTypeDefinition(CallContext context, CmisService service, String
repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
-        String typeId = getStringParameter(request, Constants.PARAM_TYPE_ID);
+        String typeId = getStringParameter(request, Constants.PARAM_ID);
 
         AtomEntryParser parser = new AtomEntryParser(request.getInputStream());
         TypeDefinition typeDefinition = parser.getTypeDefinition();
-        if ((typeDefinition == null) || !typeId.equals(typeDefinition.getParentTypeId()))
{
+        if ((typeDefinition == null) || (typeId == null) || !typeId.equals(typeDefinition.getParentTypeId()))
{
             throw new CmisInvalidArgumentException("No or invalid type defintion submitted!");
         }
 
@@ -436,7 +436,7 @@ public final class RepositoryService {
         service.createTypeDefinition(repositoryId, typeDefinitionHolder, null);
 
         // write XML
-        response.setStatus(HttpServletResponse.SC_OK);
+        response.setStatus(HttpServletResponse.SC_CREATED);
         response.setContentType(Constants.MEDIATYPE_ENTRY);
 
         AtomEntry entry = new AtomEntry();
@@ -449,11 +449,11 @@ public final class RepositoryService {
     public static void updateTypeDefinition(CallContext context, CmisService service, String
repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
-        String typeId = getStringParameter(request, Constants.PARAM_TYPE_ID);
+        String typeId = getStringParameter(request, Constants.PARAM_ID);
 
         AtomEntryParser parser = new AtomEntryParser(request.getInputStream());
         TypeDefinition typeDefinition = parser.getTypeDefinition();
-        if ((typeDefinition == null) || !typeId.equals(typeDefinition.getId())) {
+        if ((typeDefinition == null) || (typeId == null) || !typeId.equals(typeDefinition.getId()))
{
             throw new CmisInvalidArgumentException("No or invalid type defintion submitted!");
         }
 
@@ -463,7 +463,7 @@ public final class RepositoryService {
         service.updateTypeDefinition(repositoryId, typeDefinitionHolder, null);
 
         // write XML
-        response.setStatus(HttpServletResponse.SC_OK);
+        response.setStatus(HttpServletResponse.SC_CREATED);
         response.setContentType(Constants.MEDIATYPE_ENTRY);
 
         AtomEntry entry = new AtomEntry();



Mime
View raw message