You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by jm...@apache.org on 2012/06/09 20:41:02 UTC
svn commit: r1348479 - in
/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis:
client/bindings/spi/atompub/ commons/impl/
Author: jmpascal
Date: Sat Jun 9 18:41:01 2012
New Revision: 1348479
URL: http://svn.apache.org/viewvc?rev=1348479&view=rev
Log:
Bug fix.
Modified:
chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java
Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java?rev=1348479&r1=1348478&r2=1348479&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/AtomPubParser.java Sat Jun 9 18:41:01 2012
@@ -847,10 +847,15 @@ public class AtomPubParser {
skip(parser);
}
break;
-
}
- eventType = parser.next();
+
+
+ eventType = parser.getEventType();
name = parser.getName();
+ if(!(eventType == XmlPullParser.END_TAG && Constants.SELECTOR_OBJECT.equals(name))){
+ eventType = parser.next();
+ name = parser.getName();
+ }
}
// Important !
Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java?rev=1348479&r1=1348478&r2=1348479&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/DiscoveryServiceImpl.java Sat Jun 9 18:41:01 2012
@@ -109,7 +109,7 @@ public class DiscoveryServiceImpl extend
return result;
}
-
+
public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
@@ -126,12 +126,12 @@ public class DiscoveryServiceImpl extend
final Map<String, String> queryParameters = new HashMap<String, String>(6);
queryParameters.put(CmisAtomPubConstants.TAG_QUERY_STATEMENT, statement);
- queryParameters.put(Constants.PARAM_ALLOWABLE_ACTIONS, includeAllowableActions.toString());
- queryParameters.put(Constants.PARAM_ALL_VERSIONS, searchAllVersions.toString());
- queryParameters.put(Constants.PARAM_RELATIONSHIPS, includeRelationships.toString());
+ queryParameters.put(Constants.PARAM_ALLOWABLE_ACTIONS, (includeAllowableActions == null) ? null : includeAllowableActions.toString());
+ queryParameters.put(Constants.PARAM_ALL_VERSIONS, (searchAllVersions == null) ? null :searchAllVersions.toString());
+ queryParameters.put(Constants.PARAM_RELATIONSHIPS, (includeRelationships == null) ? null : includeRelationships.toString());
queryParameters.put(Constants.PARAM_RENDITION_FILTER, renditionFilter);
- queryParameters.put(Constants.PARAM_MAX_ITEMS, maxItems.toString());
- queryParameters.put(Constants.PARAM_SKIP_COUNT, skipCount.toString());
+ queryParameters.put(Constants.PARAM_MAX_ITEMS, (maxItems == null) ? null : maxItems.toString());
+ queryParameters.put(Constants.PARAM_SKIP_COUNT, (skipCount == null) ? null : skipCount.toString());
// post the query and parse results
HttpUtils.Response resp = post(url, Constants.MEDIATYPE_QUERY, new HttpUtils.Output() {
Modified: chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java?rev=1348479&r1=1348478&r2=1348479&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-android/chemistry-opencmis-android-client/src/main/java/org/apache/chemistry/opencmis/commons/impl/AtomPubConverter.java Sat Jun 9 18:41:01 2012
@@ -727,19 +727,19 @@ public class AtomPubConverter {
// -----------------------------------------------------------------
private static BigDecimal getDecimal(Map<String, String> values, String key) {
- return (values.get(key) == null || values.get(key).isEmpty()) ? null : BigDecimal.valueOf(Long.parseLong(values.get(key)));
+ return (values.get(key) == null) ? null : BigDecimal.valueOf(Long.parseLong(values.get(key)));
}
private static Boolean getBoolean(Map<String, String> values, String key) {
- return (values.get(key) == null || values.get(key).isEmpty()) ? null : Boolean.parseBoolean(values.get(key));
+ return (values.get(key) == null) ? null : Boolean.parseBoolean(values.get(key));
}
private static String getString(Map<String, String> values, String key) {
- return (values.get(key) == null || values.get(key).isEmpty()) ? null : values.get(key);
+ return (values.get(key) == null) ? null : values.get(key);
}
private static BigInteger getInteger(Map<String, String> values, String key) {
- return (values.get(key) == null || values.get(key).isEmpty()) ? null : BigInteger.valueOf(Long.parseLong(values.get(key)));
+ return (values.get(key) == null) ? null : BigInteger.valueOf(Long.parseLong(values.get(key)));
}
@SuppressWarnings("unchecked")