chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1594634 - in /chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main...
Date Wed, 14 May 2014 16:33:30 GMT
Author: fmui
Date: Wed May 14 16:33:30 2014
New Revision: 1594634

URL: http://svn.apache.org/r1594634
Log:
a few small fixes

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/token/login.jsp
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/web.xml
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/HttpUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/browser/ObjectServiceImpl.java
Wed May 14 16:33:30 2014
@@ -403,7 +403,7 @@ public class ObjectServiceImpl extends A
 
         objectId.setValue(newObj == null ? null : newObj.getId());
 
-        if (changeToken != null && newObj.getProperties() != null) {
+        if (changeToken != null && newObj != null && newObj.getProperties()
!= null) {
             Object ct = newObj.getProperties().getProperties().get(PropertyIds.CHANGE_TOKEN);
             changeToken.setValue(ct == null ? null : ct.toString());
         }
@@ -551,7 +551,7 @@ public class ObjectServiceImpl extends A
 
         objectId.setValue(newObj == null ? null : newObj.getId());
 
-        if (changeToken != null && newObj.getProperties() != null) {
+        if (changeToken != null && newObj != null && newObj.getProperties()
!= null) {
             Object ct = newObj.getProperties().getProperties().get(PropertyIds.CHANGE_TOKEN);
             changeToken.setValue(ct == null ? null : ct.toString());
         }
@@ -588,7 +588,7 @@ public class ObjectServiceImpl extends A
 
         objectId.setValue(newObj == null ? null : newObj.getId());
 
-        if (changeToken != null && newObj.getProperties() != null) {
+        if (changeToken != null && newObj != null && newObj.getProperties()
!= null) {
             Object ct = newObj.getProperties().getProperties().get(PropertyIds.CHANGE_TOKEN);
             changeToken.setValue(ct == null ? null : ct.toString());
         }
@@ -624,7 +624,7 @@ public class ObjectServiceImpl extends A
 
         objectId.setValue(newObj == null ? null : newObj.getId());
 
-        if (changeToken != null && newObj.getProperties() != null) {
+        if (changeToken != null && newObj != null && newObj.getProperties()
!= null) {
             Object ct = newObj.getProperties().getProperties().get(PropertyIds.CHANGE_TOKEN);
             changeToken.setValue(ct == null ? null : ct.toString());
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/SessionImpl.java
Wed May 14 16:33:30 2014
@@ -453,7 +453,7 @@ public class SessionImpl implements Sess
     public void setDefaultContext(OperationContext context) {
         lock.writeLock().lock();
         try {
-            context = (context == null ? DEFAULT_CONTEXT : context);
+            this.context = (context == null ? DEFAULT_CONTEXT : context);
         } finally {
             lock.writeLock().unlock();
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/token/login.jsp
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/token/login.jsp?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/token/login.jsp
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/token/login.jsp
Wed May 14 16:33:30 2014
@@ -53,7 +53,7 @@ body {
 			</tr>
 			<tr>
 				<td>Password:</td>
-				<td><input type="password" name="password" size="20"></td>
+				<td><input type="password" name="password" size="20" autocomplete="off"/></td>
 			</tr>
 			<tr>
 				<td></td>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/web.xml?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/web.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings-war/src/main/webapp/WEB-INF/web.xml
Wed May 14 16:33:30 2014
@@ -195,7 +195,4 @@
         <servlet-name>cmisbrowser</servlet-name>
         <url-pattern>/browser/*</url-pattern>
     </servlet-mapping>
-    <session-config>
-        <session-timeout>60</session-timeout>
-    </session-config>
 </web-app>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/ControlParser.java
Wed May 14 16:33:30 2014
@@ -54,6 +54,10 @@ public class ControlParser {
     private void parse() {
         // gather all controls
         Map<String, String[]> controls = request.getParameterMap();
+        if (controls == null) {
+            return;
+        }
+
         for (Map.Entry<String, String[]> control : controls.entrySet()) {
             String controlName = control.getKey().trim().toLowerCase(Locale.ENGLISH);
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/HttpUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/HttpUtils.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/HttpUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/HttpUtils.java
Wed May 14 16:33:30 2014
@@ -41,12 +41,15 @@ public final class HttpUtils {
 
         @SuppressWarnings("unchecked")
         Map<String, String[]> parameters = request.getParameterMap();
-        for (Map.Entry<String, String[]> parameter : parameters.entrySet()) {
-            if (name.equalsIgnoreCase(parameter.getKey())) {
-                if (parameter.getValue() == null) {
-                    return null;
+
+        if (parameters != null) {
+            for (Map.Entry<String, String[]> parameter : parameters.entrySet()) {
+                if (name.equalsIgnoreCase(parameter.getKey())) {
+                    if (parameter.getValue() == null) {
+                        return null;
+                    }
+                    return parameter.getValue()[0];
                 }
-                return parameter.getValue()[0];
             }
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeDefinitionFactory.java
Wed May 14 16:33:30 2014
@@ -812,6 +812,10 @@ public final class TypeDefinitionFactory
      */
     public TypeDefinitionList createTypeDefinitionList(Map<String, TypeDefinition>
allTypes, String typeId,
             Boolean includePropertyDefinitions, BigInteger maxItems, BigInteger skipCount,
CmisVersion cmisVersion) {
+        if (allTypes == null) {
+            throw new IllegalArgumentException("Types map must be set!");
+        }
+
         if (typeId != null && !allTypes.containsKey(typeId)) {
             throw new CmisObjectNotFoundException("Type '" + typeId + "' does not exist!");
         }
@@ -820,7 +824,7 @@ public final class TypeDefinitionFactory
         result.setHasMoreItems(false);
         result.setNumItems(BigInteger.ZERO);
 
-        if (allTypes == null || allTypes.isEmpty()) {
+        if (allTypes.isEmpty()) {
             return result;
         }
 
@@ -919,16 +923,20 @@ public final class TypeDefinitionFactory
      */
     public List<TypeDefinitionContainer> createTypeDescendants(Map<String, TypeDefinition>
allTypes, String typeId,
             BigInteger depth, Boolean includePropertyDefinitions, CmisVersion cmisVersion)
{
+        if (allTypes == null) {
+            throw new IllegalArgumentException("Types map must be set!");
+        }
+
         int depthInt = (depth == null ? -1 : depth.intValue());
         if (depthInt == 0) {
-            throw new CmisInvalidArgumentException("Depth must not be 0!");
+            throw new IllegalArgumentException("Depth must not be 0!");
         }
 
         if (typeId != null && !allTypes.containsKey(typeId)) {
             throw new CmisObjectNotFoundException("Type '" + typeId + "' does not exist!");
         }
 
-        if (allTypes == null || allTypes.isEmpty()) {
+        if (allTypes.isEmpty()) {
             return Collections.<TypeDefinitionContainer> emptyList();
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/JsonPrettyPrinter.java
Wed May 14 16:33:30 2014
@@ -77,15 +77,15 @@ public class JsonPrettyPrinter {
         }
     }
 
-    public static void main(String[] args) {
-        args = new String[2];
-        args[0] = "[0,{\"1\":{\"2\":{\"3\":{\"4\":[5,{\"6\":7}]}}}}]";
-        args[1] = "{\"abc\":{\"def\":{\"ghi\":{\"jkl\":[5,{\"mno\":7}]}}}}";
-        for (String s : args) {
-            JsonPrettyPrinter pp = new JsonPrettyPrinter();
-            System.out.println("Pretty Printing JSON String: " + s);
-            String result = pp.prettyPrint(s);
-            System.out.println("Pretty Printed JSON: " + result);
-        }
-    }
+//    public static void main(String[] args) {
+//        args = new String[2];
+//        args[0] = "[0,{\"1\":{\"2\":{\"3\":{\"4\":[5,{\"6\":7}]}}}}]";
+//        args[1] = "{\"abc\":{\"def\":{\"ghi\":{\"jkl\":[5,{\"mno\":7}]}}}}";
+//        for (String s : args) {
+//            JsonPrettyPrinter pp = new JsonPrettyPrinter();
+//            System.out.println("Pretty Printing JSON String: " + s);
+//            String result = pp.prettyPrint(s);
+//            System.out.println("Pretty Printed JSON: " + result);
+//        }
+//    }
 }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/filter/LoggingFilter.java
Wed May 14 16:33:30 2014
@@ -28,11 +28,8 @@ import java.io.PrintWriter;
 import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
 import java.util.Enumeration;
 import java.util.HashMap;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Scanner;
 
@@ -57,6 +54,7 @@ import javax.xml.transform.stream.Stream
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException;
+import org.apache.chemistry.opencmis.commons.impl.DateTimeHelper;
 import org.apache.chemistry.opencmis.commons.impl.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -65,7 +63,6 @@ public class LoggingFilter implements Fi
 
     private static final Logger LOG = LoggerFactory.getLogger(LoggingFilter.class);
     private static int requestNo = 0;
-    private static final SimpleDateFormat FORMAT = new SimpleDateFormat("EEE MMM dd hh:mm:ss
a z yyyy", Locale.US);
     private String logDir;
     private boolean prettyPrint = true;
     private boolean logHeaders = true;
@@ -498,7 +495,7 @@ public class LoggingFilter implements Fi
         }
 
         private String getDateString(long date) {
-            return FORMAT.format(new Date(date));
+            return DateTimeHelper.formatXmlDateTime(date);
         }
 
         @Override

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java?rev=1594634&r1=1594633&r2=1594634&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/wrapper/CmisServiceWrapperManager.java
Wed May 14 16:33:30 2014
@@ -19,6 +19,7 @@
 package org.apache.chemistry.opencmis.server.support.wrapper;
 
 import java.lang.reflect.Constructor;
+import java.util.Arrays;
 import java.util.Locale;
 import java.util.Map;
 import java.util.TreeMap;
@@ -150,8 +151,10 @@ public class CmisServiceWrapperManager {
                         throw new CmisRuntimeException("More than one service wrapper at
the same position: " + index);
                     }
 
-                    LOG.trace("Found wrapper at index {}: {}{}", index, wrapperClass.getName(),
params == null ? ""
-                            : params.toString());
+                    if (LOG.isTraceEnabled()) {
+                        LOG.trace("Found wrapper at index {}: {}{}", index, wrapperClass.getName(),
params == null ? ""
+                                : Arrays.asList(params).toString());
+                    }
 
                     wrappers.put(index, new WrapperDefinition(
                             (Class<? extends AbstractCmisServiceWrapper>) wrapperClass,
params));



Mime
View raw message