chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r936938 [12/29] - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/ chemistry-opencmis-server-bindings/src/main/java/org/apache/chem...
Date Thu, 22 Apr 2010 16:28:00 GMT
Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java Thu Apr 22 16:27:57 2010
@@ -47,364 +47,364 @@ import org.apache.chemistry.opencmis.com
  */
 public class TypeValidator {
 
-	public static void validateRequiredSystemProperties(Properties properties) {
-		if (properties == null || properties.getProperties() == null)
-			throw new RuntimeException("Cannot create object, no properties are given");
-
-		if (!properties.getProperties().containsKey(PropertyIds.OBJECT_TYPE_ID))
-			throw new RuntimeException("Cannot create object, type id is missing");
-
-	}
-
-	private static boolean isMandatorySystemProperty(String propertyId) {
-		// TODO Auto-generated method stub
-		return propertyId.equals(PropertyIds.OBJECT_TYPE_ID);
-	}
-
-	@SuppressWarnings("unchecked")
-	static <T> PropertyValidator<T> createPropertyValidator(PropertyDefinition<?> propDef) {
-		PropertyValidator<T> result = null;
-		if (propDef instanceof PropertyIntegerDefinition) {
-			result = (PropertyValidator<T>) new PropertyValidatorInteger();
-		} else if (propDef instanceof PropertyDecimalDefinition) {
-			result = (PropertyValidator<T>) new PropertyValidatorDecimal();
-		} else if (propDef instanceof PropertyStringDefinition) {
-			result = (PropertyValidator<T>) new PropertyValidatorString();
-		} else {
-			result = new PropertyValidator<T>();
-		}
-		return result;
-	}
-
-	/*
-	 * property validations: not readonly, all required are given, all are known
-	 * in type cardinality: no multi values for single value, def min max check
-	 * for Integer and Decimal, choices and in list Strings, max length set
-	 * default value for omitted properties
-	 */
-	static class PropertyValidator<T> {
-
-		public void validate(PropertyDefinition<T> propDef, PropertyData<T> prop) {
-
-			// check general constraints for all property types
-			if (propDef.getCardinality() == Cardinality.SINGLE && prop.getValues().size() > 1)
-				throw new CmisConstraintException("The property with id " + propDef.getId()
-						+ " is single valued, but multiple values are passed " + prop.getValues());
-
-			if (propDef.getChoices() != null && propDef.getChoices().size() > 0) {
-				validateChoices(propDef, prop);
-			}
-		}
-
-		private void validateChoices(PropertyDefinition<T> propDef, PropertyData<T> prop) {
-			boolean isAllowedValue = true;
-			boolean hasMultiValueChoiceLists = false;
-			for (Choice<?> allowedValue : propDef.getChoices()) {
-				if (allowedValue.getValue() != null && allowedValue.getValue().size() > 1)
-					hasMultiValueChoiceLists = true;
-			}
-
-			// check if value is in list
-			if (hasMultiValueChoiceLists) {
-				// do a complex check if this combination of actual values is
-				// allowed
-				// check if value is in list
-				isAllowedValue = false;
-				List<?> actualValues = prop.getValues();
-				for (Choice<?> allowedValue : propDef.getChoices()) {
-					if (allowedValue.getValue().size() == actualValues.size()) {
-						boolean listValuesAreEqual = true;
-						Iterator<?> it = allowedValue.getValue().iterator();
-						for (Object actualValue : actualValues) {
-							if (!actualValue.equals(it.next())) {
-								listValuesAreEqual = false;
-								break;
-							}
-						}
-						if (listValuesAreEqual) {
-							isAllowedValue = true;
-						}
-					}
-
-					if (isAllowedValue)
-						break;
-				}
-
-			} else {
-				List<T> allowedValues = getAllowedValues(propDef.getChoices());
-				// do a simpler check if all values are choice elements
-
-				for (Object actualValue : prop.getValues()) {
-					if (!allowedValues.contains(actualValue)) {
-						isAllowedValue = false;
-						break;
-					}
-				}
-			}
-
-			if (!isAllowedValue)
-				throw new CmisConstraintException("The property with id " + propDef.getId()
-						+ " has a fixed set of values. Value(s) " + prop.getValues() + " are not listed.");
-		}
-
-		/**
-		 * Calculate the list of allowed values for this property definition by
-		 * recursively collecting all choice values from property definition
-		 * 
-		 * @param propDef
-		 *            property definition
-		 * @return list of possible values in complete hierarchy
-		 */
-		private List<T> getAllowedValues(List<Choice<T>> choices) {
-			List<T> allowedValues = new ArrayList<T>(choices.size());
-			for (Choice<T> choice : choices) {
-				if (choice.getValue() != null)
-					allowedValues.add(choice.getValue().get(0));
-				if (choice.getChoice() != null) {
-					List<Choice<T>> x = choice.getChoice();
-					allowedValues.addAll(getAllowedValues(x));
-				}
-			}
-			return allowedValues;
-		}
-	}
-
-	static class PropertyValidatorInteger extends PropertyValidator<BigInteger> {
-
-		public void validate(PropertyDefinition<BigInteger> propDef, PropertyData<BigInteger> property) {
-
-			super.validate(propDef, property);
-
-			BigInteger propVal = ((PropertyInteger) property).getFirstValue();
-			BigInteger minVal = ((PropertyIntegerDefinition) propDef).getMinValue();
-			BigInteger maxVal = ((PropertyIntegerDefinition) propDef).getMaxValue();
-
-			// check min and max
-			if (minVal != null && propVal != null && propVal.compareTo(minVal) == -1) {
-				throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
-						+ " is less than the minimum value " + minVal);
-			}
-			if (maxVal != null && propVal != null && propVal.compareTo(maxVal) == 1) {
-				throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
-						+ " is bigger than the maximum value " + maxVal);
-			}
-		}
-	}
-
-	static class PropertyValidatorDecimal extends PropertyValidator<BigDecimal> {
-
-		public void validate(PropertyDefinition<BigDecimal> propDef, PropertyData<BigDecimal> property) {
-
-			super.validate(propDef, property);
-
-			BigDecimal propVal = ((PropertyDecimal) property).getFirstValue();
-			BigDecimal minVal = ((PropertyDecimalDefinition) propDef).getMinValue();
-			BigDecimal maxVal = ((PropertyDecimalDefinition) propDef).getMaxValue();
-
-			// check min and max
-			if (minVal != null && propVal != null && propVal.compareTo(minVal) == -1) {
-				throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
-						+ " is less than the minimum value " + minVal);
-			}
-			if (maxVal != null && propVal != null && propVal.compareTo(maxVal) == 1) {
-				throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
-						+ " is bigger than the maximum value " + maxVal);
-			}
-		}
-	}
-
-	static class PropertyValidatorString extends PropertyValidator<String> {
-
-		public void validate(PropertyDefinition<String> propDef, PropertyData<String> property) {
-
-			super.validate(propDef, property);
-
-			long maxLen = ((PropertyStringDefinition) propDef).getMaxLength() == null ? -1
-					: ((PropertyStringDefinition) propDef).getMaxLength().longValue();
-			long len = ((PropertyData<String>) property).getFirstValue() == null ? -1
-					: ((PropertyData<String>) property).getFirstValue().length();
-
-			// check max length
-			if (maxLen >= 0 && len >= 0 && maxLen < len) {
-				throw new CmisConstraintException("For property with id " + propDef.getId() + " the length of " + len
-						+ "is bigger than the maximum allowed length  " + maxLen);
-			}
-		}
-	}
-
-	@SuppressWarnings("unchecked")
-	public static <T> void validateProperties(TypeDefinition typeDef, Properties properties, boolean checkMandatory) {
-
-		List<String> propDefsRequired = getMandatoryPropDefs(typeDef.getPropertyDefinitions());
-
-		for (PropertyData<?> prop : properties.getProperties().values()) {
-			String propertyId = prop.getId();
-			BaseTypeId baseTypeId = typeDef.getBaseTypeId();
-
-			if (isSystemProperty(baseTypeId, propertyId))
-				continue; // ignore system properties for validation
-
-			// Check if all properties are known in the type
-			if (!typeContainsProperty(typeDef, propertyId)) {
-				throw new CmisConstraintException("Unknown property " + propertyId + " in type " + typeDef.getId());
-			}
-
-			// check that all mandatory attributes are present
-			if (checkMandatory && propDefsRequired.contains(propertyId))
-				propDefsRequired.remove(propertyId);
-
-			// check all type specific constraints:
-			PropertyDefinition<T> propDef = getPropertyDefinition(typeDef, propertyId);
-			PropertyValidator<T> validator = createPropertyValidator(propDef);
-			validator.validate(propDef, (PropertyData<T>) prop);
-		}
-
-		if (checkMandatory && !propDefsRequired.isEmpty())
-			throw new CmisConstraintException("The following mandatory properties are missing: " + propDefsRequired);
-	}
-
-	public static void validateVersionStateForCreate(DocumentTypeDefinition typeDef, VersioningState verState) {
-		if (null == verState)
-			return;
-		if (typeDef.isVersionable() && verState.equals(VersioningState.NONE) || !typeDef.isVersionable()
-				&& !verState.equals(VersioningState.NONE)) {
-			throw new CmisConstraintException("The versioning state flag is imcompatible to the type definition.");
-		}
-
-	}
-
-	public static void validateAllowedChildObjectTypes(TypeDefinition childTypeDef, List<String> allowedChildTypes) {
-
-		if (null == allowedChildTypes)
-			return; // all types are allowed
-
-		for (String allowedChildType : allowedChildTypes) {
-			if (allowedChildType.equals(childTypeDef.getId()))
-				return;
-		}
-		throw new RuntimeException("The requested type " + childTypeDef.getId() + " is not allowed in this folder");
-	}
-
-	private static List<String> getMandatoryPropDefs(Map<String, PropertyDefinition<?>> propDefs) {
-		List<String> res = new ArrayList<String>();
-		if (null != propDefs) {
-			for (PropertyDefinition<?> propDef : propDefs.values()) {
-				if (propDef.isRequired() && !isMandatorySystemProperty(propDef.getId()))
-					res.add(propDef.getId());
-			}
-		}
-		return res;
-	}
-
-	public static boolean typeContainsProperty(TypeDefinition typeDef, String propertyId) {
-
-		Map<String, PropertyDefinition<?>> propDefs = typeDef.getPropertyDefinitions();
-		if (null == propDefs)
-			return false;
-
-		PropertyDefinition<?> propDef = propDefs.get(propertyId);
-
-		if (null == propDef)
-			return false; // unknown property id in this type
-		else
-			return true;
-	}
-
-	@SuppressWarnings("unchecked")
-	private static <T> PropertyDefinition<T> getPropertyDefinition(TypeDefinition typeDef, String propertyId) {
-
-		Map<String, PropertyDefinition<?>> propDefs = typeDef.getPropertyDefinitions();
-		if (null == propDefs)
-			return null;
-
-		PropertyDefinition<?> propDef = propDefs.get(propertyId);
-
-		if (null == propDef)
-			return null; // not found
-		else
-			return (PropertyDefinition<T>) propDef;
-	}
-
-	private static boolean isSystemProperty(BaseTypeId baseTypeId, String propertyId) {
-
-		if (propertyId.equals(PropertyIds.NAME)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.OBJECT_ID)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.OBJECT_TYPE_ID)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.BASE_TYPE_ID)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.CREATED_BY)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.CREATION_DATE)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.LAST_MODIFIED_BY)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.LAST_MODIFICATION_DATE)) {
-			return true;
-		} else if (propertyId.equals(PropertyIds.CHANGE_TOKEN)) {
-			return true;
-		}
-
-		if (baseTypeId.equals(BaseTypeId.CMIS_DOCUMENT)) {
-			if (propertyId.equals(PropertyIds.IS_IMMUTABLE)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.IS_LATEST_VERSION)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.IS_MAJOR_VERSION)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.VERSION_SERIES_ID)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.IS_LATEST_MAJOR_VERSION)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.VERSION_LABEL)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.VERSION_SERIES_ID)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.CHECKIN_COMMENT)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.CONTENT_STREAM_LENGTH)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.CONTENT_STREAM_MIME_TYPE)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.CONTENT_STREAM_FILE_NAME)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.CONTENT_STREAM_ID)) {
-				return true;
-			} else {
-				return false;
-			}
-		} else if (baseTypeId.equals(BaseTypeId.CMIS_FOLDER)) {
-			if (propertyId.equals(PropertyIds.PARENT_ID)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.PATH)) {
-				return true;
-			} else {
-				return false;
-			}
-		} else if (baseTypeId.equals(BaseTypeId.CMIS_POLICY)) {
-			if (propertyId.equals(PropertyIds.SOURCE_ID)) {
-				return true;
-			} else if (propertyId.equals(PropertyIds.TARGET_ID)) {
-				return true;
-			} else {
-				return false;
-			}
-		} else { // relationship
-			if (propertyId.equals(PropertyIds.POLICY_TEXT)) {
-				return true;
-			} else {
-				return false;
-			}
-		}
-	}
+    public static void validateRequiredSystemProperties(Properties properties) {
+        if (properties == null || properties.getProperties() == null)
+            throw new RuntimeException("Cannot create object, no properties are given");
+
+        if (!properties.getProperties().containsKey(PropertyIds.OBJECT_TYPE_ID))
+            throw new RuntimeException("Cannot create object, type id is missing");
+
+    }
+
+    private static boolean isMandatorySystemProperty(String propertyId) {
+        // TODO Auto-generated method stub
+        return propertyId.equals(PropertyIds.OBJECT_TYPE_ID);
+    }
+
+    @SuppressWarnings("unchecked")
+    static <T> PropertyValidator<T> createPropertyValidator(PropertyDefinition<?> propDef) {
+        PropertyValidator<T> result = null;
+        if (propDef instanceof PropertyIntegerDefinition) {
+            result = (PropertyValidator<T>) new PropertyValidatorInteger();
+        } else if (propDef instanceof PropertyDecimalDefinition) {
+            result = (PropertyValidator<T>) new PropertyValidatorDecimal();
+        } else if (propDef instanceof PropertyStringDefinition) {
+            result = (PropertyValidator<T>) new PropertyValidatorString();
+        } else {
+            result = new PropertyValidator<T>();
+        }
+        return result;
+    }
+
+    /*
+     * property validations: not readonly, all required are given, all are known
+     * in type cardinality: no multi values for single value, def min max check
+     * for Integer and Decimal, choices and in list Strings, max length set
+     * default value for omitted properties
+     */
+    static class PropertyValidator<T> {
+
+        public void validate(PropertyDefinition<T> propDef, PropertyData<T> prop) {
+
+            // check general constraints for all property types
+            if (propDef.getCardinality() == Cardinality.SINGLE && prop.getValues().size() > 1)
+                throw new CmisConstraintException("The property with id " + propDef.getId()
+                        + " is single valued, but multiple values are passed " + prop.getValues());
+
+            if (propDef.getChoices() != null && propDef.getChoices().size() > 0) {
+                validateChoices(propDef, prop);
+            }
+        }
+
+        private void validateChoices(PropertyDefinition<T> propDef, PropertyData<T> prop) {
+            boolean isAllowedValue = true;
+            boolean hasMultiValueChoiceLists = false;
+            for (Choice<?> allowedValue : propDef.getChoices()) {
+                if (allowedValue.getValue() != null && allowedValue.getValue().size() > 1)
+                    hasMultiValueChoiceLists = true;
+            }
+
+            // check if value is in list
+            if (hasMultiValueChoiceLists) {
+                // do a complex check if this combination of actual values is
+                // allowed
+                // check if value is in list
+                isAllowedValue = false;
+                List<?> actualValues = prop.getValues();
+                for (Choice<?> allowedValue : propDef.getChoices()) {
+                    if (allowedValue.getValue().size() == actualValues.size()) {
+                        boolean listValuesAreEqual = true;
+                        Iterator<?> it = allowedValue.getValue().iterator();
+                        for (Object actualValue : actualValues) {
+                            if (!actualValue.equals(it.next())) {
+                                listValuesAreEqual = false;
+                                break;
+                            }
+                        }
+                        if (listValuesAreEqual) {
+                            isAllowedValue = true;
+                        }
+                    }
+
+                    if (isAllowedValue)
+                        break;
+                }
+
+            } else {
+                List<T> allowedValues = getAllowedValues(propDef.getChoices());
+                // do a simpler check if all values are choice elements
+
+                for (Object actualValue : prop.getValues()) {
+                    if (!allowedValues.contains(actualValue)) {
+                        isAllowedValue = false;
+                        break;
+                    }
+                }
+            }
+
+            if (!isAllowedValue)
+                throw new CmisConstraintException("The property with id " + propDef.getId()
+                        + " has a fixed set of values. Value(s) " + prop.getValues() + " are not listed.");
+        }
+
+        /**
+         * Calculate the list of allowed values for this property definition by
+         * recursively collecting all choice values from property definition
+         * 
+         * @param propDef
+         *            property definition
+         * @return list of possible values in complete hierarchy
+         */
+        private List<T> getAllowedValues(List<Choice<T>> choices) {
+            List<T> allowedValues = new ArrayList<T>(choices.size());
+            for (Choice<T> choice : choices) {
+                if (choice.getValue() != null)
+                    allowedValues.add(choice.getValue().get(0));
+                if (choice.getChoice() != null) {
+                    List<Choice<T>> x = choice.getChoice();
+                    allowedValues.addAll(getAllowedValues(x));
+                }
+            }
+            return allowedValues;
+        }
+    }
+
+    static class PropertyValidatorInteger extends PropertyValidator<BigInteger> {
+
+        public void validate(PropertyDefinition<BigInteger> propDef, PropertyData<BigInteger> property) {
+
+            super.validate(propDef, property);
+
+            BigInteger propVal = ((PropertyInteger) property).getFirstValue();
+            BigInteger minVal = ((PropertyIntegerDefinition) propDef).getMinValue();
+            BigInteger maxVal = ((PropertyIntegerDefinition) propDef).getMaxValue();
+
+            // check min and max
+            if (minVal != null && propVal != null && propVal.compareTo(minVal) == -1) {
+                throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
+                        + " is less than the minimum value " + minVal);
+            }
+            if (maxVal != null && propVal != null && propVal.compareTo(maxVal) == 1) {
+                throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
+                        + " is bigger than the maximum value " + maxVal);
+            }
+        }
+    }
+
+    static class PropertyValidatorDecimal extends PropertyValidator<BigDecimal> {
+
+        public void validate(PropertyDefinition<BigDecimal> propDef, PropertyData<BigDecimal> property) {
+
+            super.validate(propDef, property);
+
+            BigDecimal propVal = ((PropertyDecimal) property).getFirstValue();
+            BigDecimal minVal = ((PropertyDecimalDefinition) propDef).getMinValue();
+            BigDecimal maxVal = ((PropertyDecimalDefinition) propDef).getMaxValue();
+
+            // check min and max
+            if (minVal != null && propVal != null && propVal.compareTo(minVal) == -1) {
+                throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
+                        + " is less than the minimum value " + minVal);
+            }
+            if (maxVal != null && propVal != null && propVal.compareTo(maxVal) == 1) {
+                throw new CmisConstraintException("For property with id " + propDef.getId() + " the value " + propVal
+                        + " is bigger than the maximum value " + maxVal);
+            }
+        }
+    }
+
+    static class PropertyValidatorString extends PropertyValidator<String> {
+
+        public void validate(PropertyDefinition<String> propDef, PropertyData<String> property) {
+
+            super.validate(propDef, property);
+
+            long maxLen = ((PropertyStringDefinition) propDef).getMaxLength() == null ? -1
+                    : ((PropertyStringDefinition) propDef).getMaxLength().longValue();
+            long len = ((PropertyData<String>) property).getFirstValue() == null ? -1
+                    : ((PropertyData<String>) property).getFirstValue().length();
+
+            // check max length
+            if (maxLen >= 0 && len >= 0 && maxLen < len) {
+                throw new CmisConstraintException("For property with id " + propDef.getId() + " the length of " + len
+                        + "is bigger than the maximum allowed length  " + maxLen);
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public static <T> void validateProperties(TypeDefinition typeDef, Properties properties, boolean checkMandatory) {
+
+        List<String> propDefsRequired = getMandatoryPropDefs(typeDef.getPropertyDefinitions());
+
+        for (PropertyData<?> prop : properties.getProperties().values()) {
+            String propertyId = prop.getId();
+            BaseTypeId baseTypeId = typeDef.getBaseTypeId();
+
+            if (isSystemProperty(baseTypeId, propertyId))
+                continue; // ignore system properties for validation
+
+            // Check if all properties are known in the type
+            if (!typeContainsProperty(typeDef, propertyId)) {
+                throw new CmisConstraintException("Unknown property " + propertyId + " in type " + typeDef.getId());
+            }
+
+            // check that all mandatory attributes are present
+            if (checkMandatory && propDefsRequired.contains(propertyId))
+                propDefsRequired.remove(propertyId);
+
+            // check all type specific constraints:
+            PropertyDefinition<T> propDef = getPropertyDefinition(typeDef, propertyId);
+            PropertyValidator<T> validator = createPropertyValidator(propDef);
+            validator.validate(propDef, (PropertyData<T>) prop);
+        }
+
+        if (checkMandatory && !propDefsRequired.isEmpty())
+            throw new CmisConstraintException("The following mandatory properties are missing: " + propDefsRequired);
+    }
+
+    public static void validateVersionStateForCreate(DocumentTypeDefinition typeDef, VersioningState verState) {
+        if (null == verState)
+            return;
+        if (typeDef.isVersionable() && verState.equals(VersioningState.NONE) || !typeDef.isVersionable()
+                && !verState.equals(VersioningState.NONE)) {
+            throw new CmisConstraintException("The versioning state flag is imcompatible to the type definition.");
+        }
+
+    }
+
+    public static void validateAllowedChildObjectTypes(TypeDefinition childTypeDef, List<String> allowedChildTypes) {
+
+        if (null == allowedChildTypes)
+            return; // all types are allowed
+
+        for (String allowedChildType : allowedChildTypes) {
+            if (allowedChildType.equals(childTypeDef.getId()))
+                return;
+        }
+        throw new RuntimeException("The requested type " + childTypeDef.getId() + " is not allowed in this folder");
+    }
+
+    private static List<String> getMandatoryPropDefs(Map<String, PropertyDefinition<?>> propDefs) {
+        List<String> res = new ArrayList<String>();
+        if (null != propDefs) {
+            for (PropertyDefinition<?> propDef : propDefs.values()) {
+                if (propDef.isRequired() && !isMandatorySystemProperty(propDef.getId()))
+                    res.add(propDef.getId());
+            }
+        }
+        return res;
+    }
+
+    public static boolean typeContainsProperty(TypeDefinition typeDef, String propertyId) {
+
+        Map<String, PropertyDefinition<?>> propDefs = typeDef.getPropertyDefinitions();
+        if (null == propDefs)
+            return false;
+
+        PropertyDefinition<?> propDef = propDefs.get(propertyId);
+
+        if (null == propDef)
+            return false; // unknown property id in this type
+        else
+            return true;
+    }
+
+    @SuppressWarnings("unchecked")
+    private static <T> PropertyDefinition<T> getPropertyDefinition(TypeDefinition typeDef, String propertyId) {
+
+        Map<String, PropertyDefinition<?>> propDefs = typeDef.getPropertyDefinitions();
+        if (null == propDefs)
+            return null;
+
+        PropertyDefinition<?> propDef = propDefs.get(propertyId);
+
+        if (null == propDef)
+            return null; // not found
+        else
+            return (PropertyDefinition<T>) propDef;
+    }
+
+    private static boolean isSystemProperty(BaseTypeId baseTypeId, String propertyId) {
+
+        if (propertyId.equals(PropertyIds.NAME)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.OBJECT_ID)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.OBJECT_TYPE_ID)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.BASE_TYPE_ID)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.CREATED_BY)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.CREATION_DATE)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.LAST_MODIFIED_BY)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.LAST_MODIFICATION_DATE)) {
+            return true;
+        } else if (propertyId.equals(PropertyIds.CHANGE_TOKEN)) {
+            return true;
+        }
+
+        if (baseTypeId.equals(BaseTypeId.CMIS_DOCUMENT)) {
+            if (propertyId.equals(PropertyIds.IS_IMMUTABLE)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.IS_LATEST_VERSION)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.IS_MAJOR_VERSION)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.VERSION_SERIES_ID)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.IS_LATEST_MAJOR_VERSION)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.VERSION_LABEL)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.VERSION_SERIES_ID)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.IS_VERSION_SERIES_CHECKED_OUT)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.VERSION_SERIES_CHECKED_OUT_BY)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.VERSION_SERIES_CHECKED_OUT_ID)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.CHECKIN_COMMENT)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.CONTENT_STREAM_LENGTH)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.CONTENT_STREAM_MIME_TYPE)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.CONTENT_STREAM_FILE_NAME)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.CONTENT_STREAM_ID)) {
+                return true;
+            } else {
+                return false;
+            }
+        } else if (baseTypeId.equals(BaseTypeId.CMIS_FOLDER)) {
+            if (propertyId.equals(PropertyIds.PARENT_ID)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.PATH)) {
+                return true;
+            } else {
+                return false;
+            }
+        } else if (baseTypeId.equals(BaseTypeId.CMIS_POLICY)) {
+            if (propertyId.equals(PropertyIds.SOURCE_ID)) {
+                return true;
+            } else if (propertyId.equals(PropertyIds.TARGET_ID)) {
+                return true;
+            } else {
+                return false;
+            }
+        } else { // relationship
+            if (propertyId.equals(PropertyIds.POLICY_TEXT)) {
+                return true;
+            } else {
+                return false;
+            }
+        }
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/AbstractService.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/AbstractService.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/AbstractService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/AbstractService.java Thu Apr 22 16:27:57 2010
@@ -21,16 +21,16 @@ package org.apache.chemistry.opencmis.in
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
 
 public class AbstractService {
-	protected CallContext fDummyCallContext;
+    protected CallContext fDummyCallContext;
 
-	protected AbstractService() {
-	}
+    protected AbstractService() {
+    }
 
-	public void setCallContext(CallContext ctx) {
-		fDummyCallContext = ctx;
-	}
+    public void setCallContext(CallContext ctx) {
+        fDummyCallContext = ctx;
+    }
 
-	public CallContext getCallContext() {
-		return fDummyCallContext;
-	}
+    public CallContext getCallContext() {
+        return fDummyCallContext;
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemoryProvider.java Thu Apr 22 16:27:57 2010
@@ -51,91 +51,91 @@ import org.apache.chemistry.opencmis.inm
  */
 public class CmisInMemoryProvider {
 
-	protected StoreManager fStoreManager;
-	protected RepositoryService fRepositoryService;
-	protected NavigationService fNavigationService;
-	protected ObjectService fObjectService;
-	protected VersioningService fVersioningService;
-	protected MultiFilingService fMultiService;
-	protected RepositoryInfo fRepositoryInfo;
-	protected DiscoveryService fDiscoveryService;
-
-	public CmisInMemoryProvider(Map<String, String> cfgParams) {
-		setup(cfgParams);
-	}
-
-	protected CmisInMemoryProvider() {
-	}
-
-	public RepositoryService getRepositoryService() {
-		return fRepositoryService;
-	}
-
-	public NavigationService getNavigationService() {
-		return fNavigationService;
-	}
-
-	public ObjectService getObjectService() {
-		return fObjectService;
-	}
-
-	public VersioningService getVersioningService() {
-		return fVersioningService;
-	}
-
-	public RelationshipService getRelationshipService() {
-		return null;
-	}
-
-	public DiscoveryService getDiscoveryService() {
-		return fDiscoveryService;
-	}
-
-	public MultiFilingService getMultiFilingService() {
-		return fMultiService;
-	}
-
-	public AclService getAclService() {
-		return null;
-	}
-
-	public PolicyService getPolicyService() {
-		return null;
-	}
-
-	protected void setup(Map<String, String> cfgParams) {
-		String repositoryClassName = (String) cfgParams.get(ConfigConstants.REPOSITORY_CLASS);
-		if (null == repositoryClassName)
-			repositoryClassName = StoreManagerImpl.class.getName();
-
-		fStoreManager = StoreManagerFactory.createInstance(repositoryClassName);
-		String repositoryId = (String) cfgParams.get(ConfigConstants.REPOSITORY_ID);
-
-		// first create repository
-		if (null != repositoryId) {
-			// then create/initialize type system
-			String typeCreatorClassName = (String) cfgParams.get(ConfigConstants.TYPE_CREATOR_CLASS);
-			fStoreManager.createAndInitRepository(repositoryId, typeCreatorClassName);
-		} else {
-			// then init repository (note: loads root folder which requires
-			// cmis:folder type available)
-			fStoreManager.initRepository(null);
-		}
-
-		InMemoryRepositoryServiceImpl repSvc = new InMemoryRepositoryServiceImpl(fStoreManager);
-		InMemoryNavigationServiceImpl navSvc = new InMemoryNavigationServiceImpl(fStoreManager);
-		InMemoryObjectServiceImpl objSvc = new InMemoryObjectServiceImpl(fStoreManager);
-		InMemoryVersioningServiceImpl verSvc = new InMemoryVersioningServiceImpl(fStoreManager, objSvc);
-		InMemoryDiscoveryServiceImpl disSvc = new InMemoryDiscoveryServiceImpl(fStoreManager, repSvc, navSvc);
-		InMemoryMultiFilingServiceImpl multiSvc = new InMemoryMultiFilingServiceImpl(fStoreManager);
-
-		// initialize services
-		fRepositoryService = new RepositoryServiceImpl(repSvc);
-		fNavigationService = new NavigationServiceImpl(navSvc);
-		fObjectService = new ObjectServiceImpl(objSvc);
-		fVersioningService = new VersioningServiceImpl(verSvc);
-		fMultiService = new MultiFilingServiceImpl(multiSvc);
-		fDiscoveryService = new DiscoveryServiceImpl(disSvc);
-	}
+    protected StoreManager fStoreManager;
+    protected RepositoryService fRepositoryService;
+    protected NavigationService fNavigationService;
+    protected ObjectService fObjectService;
+    protected VersioningService fVersioningService;
+    protected MultiFilingService fMultiService;
+    protected RepositoryInfo fRepositoryInfo;
+    protected DiscoveryService fDiscoveryService;
+
+    public CmisInMemoryProvider(Map<String, String> cfgParams) {
+        setup(cfgParams);
+    }
+
+    protected CmisInMemoryProvider() {
+    }
+
+    public RepositoryService getRepositoryService() {
+        return fRepositoryService;
+    }
+
+    public NavigationService getNavigationService() {
+        return fNavigationService;
+    }
+
+    public ObjectService getObjectService() {
+        return fObjectService;
+    }
+
+    public VersioningService getVersioningService() {
+        return fVersioningService;
+    }
+
+    public RelationshipService getRelationshipService() {
+        return null;
+    }
+
+    public DiscoveryService getDiscoveryService() {
+        return fDiscoveryService;
+    }
+
+    public MultiFilingService getMultiFilingService() {
+        return fMultiService;
+    }
+
+    public AclService getAclService() {
+        return null;
+    }
+
+    public PolicyService getPolicyService() {
+        return null;
+    }
+
+    protected void setup(Map<String, String> cfgParams) {
+        String repositoryClassName = (String) cfgParams.get(ConfigConstants.REPOSITORY_CLASS);
+        if (null == repositoryClassName)
+            repositoryClassName = StoreManagerImpl.class.getName();
+
+        fStoreManager = StoreManagerFactory.createInstance(repositoryClassName);
+        String repositoryId = (String) cfgParams.get(ConfigConstants.REPOSITORY_ID);
+
+        // first create repository
+        if (null != repositoryId) {
+            // then create/initialize type system
+            String typeCreatorClassName = (String) cfgParams.get(ConfigConstants.TYPE_CREATOR_CLASS);
+            fStoreManager.createAndInitRepository(repositoryId, typeCreatorClassName);
+        } else {
+            // then init repository (note: loads root folder which requires
+            // cmis:folder type available)
+            fStoreManager.initRepository(null);
+        }
+
+        InMemoryRepositoryServiceImpl repSvc = new InMemoryRepositoryServiceImpl(fStoreManager);
+        InMemoryNavigationServiceImpl navSvc = new InMemoryNavigationServiceImpl(fStoreManager);
+        InMemoryObjectServiceImpl objSvc = new InMemoryObjectServiceImpl(fStoreManager);
+        InMemoryVersioningServiceImpl verSvc = new InMemoryVersioningServiceImpl(fStoreManager, objSvc);
+        InMemoryDiscoveryServiceImpl disSvc = new InMemoryDiscoveryServiceImpl(fStoreManager, repSvc, navSvc);
+        InMemoryMultiFilingServiceImpl multiSvc = new InMemoryMultiFilingServiceImpl(fStoreManager);
+
+        // initialize services
+        fRepositoryService = new RepositoryServiceImpl(repSvc);
+        fNavigationService = new NavigationServiceImpl(navSvc);
+        fObjectService = new ObjectServiceImpl(objSvc);
+        fVersioningService = new VersioningServiceImpl(verSvc);
+        fMultiService = new MultiFilingServiceImpl(multiSvc);
+        fDiscoveryService = new DiscoveryServiceImpl(disSvc);
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpi.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpi.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpi.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpi.java Thu Apr 22 16:27:57 2010
@@ -46,168 +46,168 @@ import org.apache.chemistry.opencmis.inm
  */
 public class CmisInMemorySpi extends CmisInMemoryProvider implements CmisSpi {
 
-	// private static Log log = LogFactory.getLog(CmisInMemorySpi.class);
-	private Session fSession;
+    // private static Log log = LogFactory.getLog(CmisInMemorySpi.class);
+    private Session fSession;
 
-	CmisInMemorySpi(Session session) { // package visibility
-		fSession = session;
-		setup();
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#getRepositoryService()
-	 */
-	public RepositoryService getRepositoryService() {
-		return fRepositoryService;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPIFactory#getSPIInstance
-	 * (org.apache.opencmis.client. provider.spi.Session)
-	 */
-	public CmisSpi getSpiInstance(Session session) {
-		fSession = session;
-		setup();
-		return this;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.opencmis.client.provider.spi.CMISSPI#getACLService()
-	 */
-	public AclService getAclService() {
-		// TODO to be completed if ACLs are implemented
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#getDiscoveryService()
-	 */
-	public DiscoveryService getDiscoveryService() {
-		// TODO to be completed if query is implemented
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#getMultiFilingService()
-	 */
-	public MultiFilingService getMultiFilingService() {
-		return fMultiService;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#getNavigationService()
-	 */
-	public NavigationService getNavigationService() {
-		return fNavigationService;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.opencmis.client.provider.spi.CMISSPI#getObjectService()
-	 */
-	public ObjectService getObjectService() {
-		return fObjectService;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.opencmis.client.provider.spi.CMISSPI#getPolicyService()
-	 */
-	public PolicyService getPolicyService() {
-		// TODO to be completed if policies are implemented
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#getRelationshipService()
-	 */
-	public RelationshipService getRelationshipService() {
-		// TODO to be completed if relationships are implemented
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#getVersioningService()
-	 */
-	public VersioningService getVersioningService() {
-		return fVersioningService;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.apache.opencmis.client.provider.spi.CMISSPI#clearAllCaches()
-	 */
-	public void clearAllCaches() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.spi.CMISSPI#clearRepositoryCache(
-	 * java.lang.String)
-	 */
-	public void clearRepositoryCache(String repositoryId) {
-	}
-
-	public void close() {
-	}
-
-	/**
-	 * Returns the repository info.
-	 */
-	public RepositoryInfo getRepositoryInfo() {
-		return fRepositoryInfo;
-	}
-
-	public String getStoredObjectFactoryName() {
-		return StoreManagerImpl.class.getName();
-	}
-
-	public StoreManager getStoreManager() {
-		return fStoreManager;
-	}
-
-	// ---- internal ----
-
-	private void setup() {
-		Map<String, String> cfgParams = new HashMap<String, String>();
-		String[] configParamKeys = { ConfigConstants.REPOSITORY_CLASS, ConfigConstants.REPOSITORY_ID,
-				ConfigConstants.TYPE_CREATOR_CLASS };
-
-		for (String key : configParamKeys) {
-			String value = (String) fSession.get(key);
-			if (null != value)
-				cfgParams.put(key, value);
-		}
+    CmisInMemorySpi(Session session) { // package visibility
+        fSession = session;
+        setup();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#getRepositoryService()
+     */
+    public RepositoryService getRepositoryService() {
+        return fRepositoryService;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPIFactory#getSPIInstance
+     * (org.apache.opencmis.client. provider.spi.Session)
+     */
+    public CmisSpi getSpiInstance(Session session) {
+        fSession = session;
+        setup();
+        return this;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.opencmis.client.provider.spi.CMISSPI#getACLService()
+     */
+    public AclService getAclService() {
+        // TODO to be completed if ACLs are implemented
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#getDiscoveryService()
+     */
+    public DiscoveryService getDiscoveryService() {
+        // TODO to be completed if query is implemented
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#getMultiFilingService()
+     */
+    public MultiFilingService getMultiFilingService() {
+        return fMultiService;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#getNavigationService()
+     */
+    public NavigationService getNavigationService() {
+        return fNavigationService;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.opencmis.client.provider.spi.CMISSPI#getObjectService()
+     */
+    public ObjectService getObjectService() {
+        return fObjectService;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.opencmis.client.provider.spi.CMISSPI#getPolicyService()
+     */
+    public PolicyService getPolicyService() {
+        // TODO to be completed if policies are implemented
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#getRelationshipService()
+     */
+    public RelationshipService getRelationshipService() {
+        // TODO to be completed if relationships are implemented
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#getVersioningService()
+     */
+    public VersioningService getVersioningService() {
+        return fVersioningService;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.opencmis.client.provider.spi.CMISSPI#clearAllCaches()
+     */
+    public void clearAllCaches() {
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.spi.CMISSPI#clearRepositoryCache(
+     * java.lang.String)
+     */
+    public void clearRepositoryCache(String repositoryId) {
+    }
+
+    public void close() {
+    }
+
+    /**
+     * Returns the repository info.
+     */
+    public RepositoryInfo getRepositoryInfo() {
+        return fRepositoryInfo;
+    }
+
+    public String getStoredObjectFactoryName() {
+        return StoreManagerImpl.class.getName();
+    }
+
+    public StoreManager getStoreManager() {
+        return fStoreManager;
+    }
+
+    // ---- internal ----
+
+    private void setup() {
+        Map<String, String> cfgParams = new HashMap<String, String>();
+        String[] configParamKeys = { ConfigConstants.REPOSITORY_CLASS, ConfigConstants.REPOSITORY_ID,
+                ConfigConstants.TYPE_CREATOR_CLASS };
+
+        for (String key : configParamKeys) {
+            String value = (String) fSession.get(key);
+            if (null != value)
+                cfgParams.put(key, value);
+        }
 
-		super.setup(cfgParams);
-	}
+        super.setup(cfgParams);
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpiFactory.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpiFactory.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpiFactory.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/CmisInMemorySpiFactory.java Thu Apr 22 16:27:57 2010
@@ -35,19 +35,19 @@ import org.apache.chemistry.opencmis.cli
  */
 public class CmisInMemorySpiFactory implements CmisSpiFactory {
 
-	private static Map<Integer, CmisInMemorySpi> IN_MEM_SPIS = new HashMap<Integer, CmisInMemorySpi>();
+    private static Map<Integer, CmisInMemorySpi> IN_MEM_SPIS = new HashMap<Integer, CmisInMemorySpi>();
 
-	public CmisSpi getSpiInstance(Session session) {
-		// we maintain one InMemory SPI for each session
+    public CmisSpi getSpiInstance(Session session) {
+        // we maintain one InMemory SPI for each session
 
-		int sessionId = System.identityHashCode(session);
-		CmisInMemorySpi spi = IN_MEM_SPIS.get(sessionId);
-		if (null == spi) {
-			// does not yet exist, create one:
-			spi = new CmisInMemorySpi(session);
-			IN_MEM_SPIS.put(sessionId, spi);
-		}
-		return spi;
-	}
+        int sessionId = System.identityHashCode(session);
+        CmisInMemorySpi spi = IN_MEM_SPIS.get(sessionId);
+        if (null == spi) {
+            // does not yet exist, create one:
+            spi = new CmisInMemorySpi(session);
+            IN_MEM_SPIS.put(sessionId, spi);
+        }
+        return spi;
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DiscoveryServiceImpl.java Thu Apr 22 16:27:57 2010
@@ -29,25 +29,25 @@ import org.apache.chemistry.opencmis.inm
 
 public class DiscoveryServiceImpl extends AbstractService implements DiscoveryService {
 
-	private InMemoryDiscoveryServiceImpl fDiscoverySvc;
+    private InMemoryDiscoveryServiceImpl fDiscoverySvc;
 
-	public DiscoveryServiceImpl(InMemoryDiscoveryServiceImpl disSvc) {
-		fDiscoverySvc = disSvc;
-	}
-
-	public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
-			String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
-
-		return fDiscoverySvc.getContentChanges(fDummyCallContext, repositoryId, changeLogToken, includeProperties,
-				filter, includePolicyIds, includeAcl, maxItems, extension, null);
-	}
-
-	public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
-			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
-
-		return fDiscoverySvc.query(fDummyCallContext, repositoryId, statement, searchAllVersions,
-				includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension);
-	}
+    public DiscoveryServiceImpl(InMemoryDiscoveryServiceImpl disSvc) {
+        fDiscoverySvc = disSvc;
+    }
+
+    public ObjectList getContentChanges(String repositoryId, Holder<String> changeLogToken, Boolean includeProperties,
+            String filter, Boolean includePolicyIds, Boolean includeAcl, BigInteger maxItems, ExtensionsData extension) {
+
+        return fDiscoverySvc.getContentChanges(fDummyCallContext, repositoryId, changeLogToken, includeProperties,
+                filter, includePolicyIds, includeAcl, maxItems, extension, null);
+    }
+
+    public ObjectList query(String repositoryId, String statement, Boolean searchAllVersions,
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+
+        return fDiscoverySvc.query(fDummyCallContext, repositoryId, statement, searchAllVersions,
+                includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension);
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DummyCallContext.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DummyCallContext.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DummyCallContext.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/DummyCallContext.java Thu Apr 22 16:27:57 2010
@@ -6,43 +6,43 @@ import java.util.Map;
 import org.apache.chemistry.opencmis.commons.api.server.CallContext;
 
 public class DummyCallContext implements CallContext {
-	private Map<String, String> fParameter = new HashMap<String, String>();
+    private Map<String, String> fParameter = new HashMap<String, String>();
 
-	public DummyCallContext() {
-		fParameter.put(USERNAME, "TestUser");
-		fParameter.put(PASSWORD, "secret");
-		fParameter.put(LOCALE, "en");
-	}
-
-	public boolean isObjectInfoRequired() {
-		return false;
-	}
-
-	public String get(String key) {
-		return fParameter.get(key);
-	}
-
-	public String getBinding() {
-		return BINDING_ATOMPUB;
-	}
-
-	public String getRepositoryId() {
-		return get(REPOSITORY_ID);
-	}
-
-	public String getLocale() {
-		return get(LOCALE);
-	}
-
-	public String getPassword() {
-		return get(PASSWORD);
-	}
-
-	public String getUsername() {
-		return get(USERNAME);
-	}
-
-	public void put(String key, String value) {
-		fParameter.put(key, value);
-	}
+    public DummyCallContext() {
+        fParameter.put(USERNAME, "TestUser");
+        fParameter.put(PASSWORD, "secret");
+        fParameter.put(LOCALE, "en");
+    }
+
+    public boolean isObjectInfoRequired() {
+        return false;
+    }
+
+    public String get(String key) {
+        return fParameter.get(key);
+    }
+
+    public String getBinding() {
+        return BINDING_ATOMPUB;
+    }
+
+    public String getRepositoryId() {
+        return get(REPOSITORY_ID);
+    }
+
+    public String getLocale() {
+        return get(LOCALE);
+    }
+
+    public String getPassword() {
+        return get(PASSWORD);
+    }
+
+    public String getUsername() {
+        return get(USERNAME);
+    }
+
+    public void put(String key, String value) {
+        fParameter.put(key, value);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/MultiFilingServiceImpl.java Thu Apr 22 16:27:57 2010
@@ -24,20 +24,20 @@ import org.apache.chemistry.opencmis.inm
 
 public class MultiFilingServiceImpl extends AbstractService implements MultiFilingService {
 
-	private InMemoryMultiFilingServiceImpl fMultiSvc;
+    private InMemoryMultiFilingServiceImpl fMultiSvc;
 
-	public MultiFilingServiceImpl(InMemoryMultiFilingServiceImpl multiSvc) {
-		fMultiSvc = multiSvc;
-	}
+    public MultiFilingServiceImpl(InMemoryMultiFilingServiceImpl multiSvc) {
+        fMultiSvc = multiSvc;
+    }
 
-	public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
-			ExtensionsData extension) {
+    public void addObjectToFolder(String repositoryId, String objectId, String folderId, Boolean allVersions,
+            ExtensionsData extension) {
 
-		fMultiSvc.addObjectToFolder(fDummyCallContext, repositoryId, objectId, folderId, allVersions, extension, null);
-	}
+        fMultiSvc.addObjectToFolder(fDummyCallContext, repositoryId, objectId, folderId, allVersions, extension, null);
+    }
 
-	public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
+    public void removeObjectFromFolder(String repositoryId, String objectId, String folderId, ExtensionsData extension) {
 
-		fMultiSvc.removeObjectFromFolder(fDummyCallContext, repositoryId, objectId, folderId, extension, null);
-	}
+        fMultiSvc.removeObjectFromFolder(fDummyCallContext, repositoryId, objectId, folderId, extension, null);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/NavigationServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/NavigationServiceImpl.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/NavigationServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/NavigationServiceImpl.java Thu Apr 22 16:27:57 2010
@@ -38,54 +38,54 @@ import org.apache.chemistry.opencmis.inm
  */
 
 public class NavigationServiceImpl extends AbstractService implements NavigationService {
-	private InMemoryNavigationServiceImpl fNavSvc;
+    private InMemoryNavigationServiceImpl fNavSvc;
 
-	public NavigationServiceImpl(InMemoryNavigationServiceImpl navSvc) {
-		fNavSvc = navSvc;
-	}
+    public NavigationServiceImpl(InMemoryNavigationServiceImpl navSvc) {
+        fNavSvc = navSvc;
+    }
 
-	public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
-			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+    public ObjectList getCheckedOutDocs(String repositoryId, String folderId, String filter, String orderBy,
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
 
-		return fNavSvc.getCheckedOutDocs(fDummyCallContext, repositoryId, folderId, filter, orderBy,
-				includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension, null);
-	}
+        return fNavSvc.getCheckedOutDocs(fDummyCallContext, repositoryId, folderId, filter, orderBy,
+                includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, extension, null);
+    }
 
-	public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
-			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+    public ObjectInFolderList getChildren(String repositoryId, String folderId, String filter, String orderBy,
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includePathSegment, BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
 
-		return fNavSvc.getChildren(fDummyCallContext, repositoryId, folderId, filter, orderBy, includeAllowableActions,
-				includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension, null);
-	}
+        return fNavSvc.getChildren(fDummyCallContext, repositoryId, folderId, filter, orderBy, includeAllowableActions,
+                includeRelationships, renditionFilter, includePathSegment, maxItems, skipCount, extension, null);
+    }
 
-	public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
-			String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
-			String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+    public List<ObjectInFolderContainer> getDescendants(String repositoryId, String folderId, BigInteger depth,
+            String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+            String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
 
-		return fNavSvc.getDescendants(fDummyCallContext, repositoryId, folderId, depth, filter,
-				includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, extension, null);
-	}
+        return fNavSvc.getDescendants(fDummyCallContext, repositoryId, folderId, depth, filter,
+                includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, extension, null);
+    }
 
-	public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
+    public ObjectData getFolderParent(String repositoryId, String folderId, String filter, ExtensionsData extension) {
 
-		return fNavSvc.getFolderParent(fDummyCallContext, repositoryId, folderId, filter, extension, null);
-	}
+        return fNavSvc.getFolderParent(fDummyCallContext, repositoryId, folderId, filter, extension, null);
+    }
 
-	public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
-			String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
-			String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
+    public List<ObjectInFolderContainer> getFolderTree(String repositoryId, String folderId, BigInteger depth,
+            String filter, Boolean includeAllowableActions, IncludeRelationships includeRelationships,
+            String renditionFilter, Boolean includePathSegment, ExtensionsData extension) {
 
-		return fNavSvc.getDescendants(fDummyCallContext, repositoryId, folderId, depth, filter,
-				includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, extension, null);
-	}
+        return fNavSvc.getDescendants(fDummyCallContext, repositoryId, folderId, depth, filter,
+                includeAllowableActions, includeRelationships, renditionFilter, includePathSegment, extension, null);
+    }
 
-	public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
-			Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
-			Boolean includeRelativePathSegment, ExtensionsData extension) {
+    public List<ObjectParentData> getObjectParents(String repositoryId, String objectId, String filter,
+            Boolean includeAllowableActions, IncludeRelationships includeRelationships, String renditionFilter,
+            Boolean includeRelativePathSegment, ExtensionsData extension) {
 
-		return fNavSvc.getObjectParents(fDummyCallContext, repositoryId, objectId, filter, includeAllowableActions,
-				includeRelationships, renditionFilter, includeRelativePathSegment, extension, null);
-	}
+        return fNavSvc.getObjectParents(fDummyCallContext, repositoryId, objectId, filter, includeAllowableActions,
+                includeRelationships, renditionFilter, includeRelativePathSegment, extension, null);
+    }
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/ObjectServiceImpl.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/ObjectServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/ObjectServiceImpl.java Thu Apr 22 16:27:57 2010
@@ -39,124 +39,124 @@ import org.apache.chemistry.opencmis.inm
 
 public class ObjectServiceImpl extends AbstractService implements ObjectService {
 
-	private InMemoryObjectServiceImpl fObjSvc;
+    private InMemoryObjectServiceImpl fObjSvc;
 
-	public ObjectServiceImpl(InMemoryObjectServiceImpl objSvc) {
-		fObjSvc = objSvc;
-	}
+    public ObjectServiceImpl(InMemoryObjectServiceImpl objSvc) {
+        fObjSvc = objSvc;
+    }
 
-	public String createDocument(String repositoryId, Properties properties, String folderId,
-			ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
-			Acl removeAces, ExtensionsData extension) {
+    public String createDocument(String repositoryId, Properties properties, String folderId,
+            ContentStream contentStream, VersioningState versioningState, List<String> policies, Acl addAces,
+            Acl removeAces, ExtensionsData extension) {
 
-		return fObjSvc.createDocument(fDummyCallContext, repositoryId, properties, folderId, contentStream,
-				versioningState, policies, addAces, removeAces, extension);
-	}
+        return fObjSvc.createDocument(fDummyCallContext, repositoryId, properties, folderId, contentStream,
+                versioningState, policies, addAces, removeAces, extension);
+    }
 
-	public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
-			String folderId, VersioningState versioningState, List<String> policies, Acl addAces, Acl removeAces,
-			ExtensionsData extension) {
+    public String createDocumentFromSource(String repositoryId, String sourceId, Properties properties,
+            String folderId, VersioningState versioningState, List<String> policies, Acl addAces, Acl removeAces,
+            ExtensionsData extension) {
 
-		return fObjSvc.createDocumentFromSource(fDummyCallContext, repositoryId, sourceId, properties, folderId,
-				versioningState, policies, addAces, removeAces, extension);
-	}
+        return fObjSvc.createDocumentFromSource(fDummyCallContext, repositoryId, sourceId, properties, folderId,
+                versioningState, policies, addAces, removeAces, extension);
+    }
 
-	public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
-			Acl addAces, Acl removeAces, ExtensionsData extension) {
+    public String createFolder(String repositoryId, Properties properties, String folderId, List<String> policies,
+            Acl addAces, Acl removeAces, ExtensionsData extension) {
 
-		return fObjSvc.createFolder(fDummyCallContext, repositoryId, properties, folderId, policies, addAces,
-				removeAces, extension);
-	}
+        return fObjSvc.createFolder(fDummyCallContext, repositoryId, properties, folderId, policies, addAces,
+                removeAces, extension);
+    }
 
-	public String createPolicy(String repositoryId, Properties properties, String folderId, List<String> policies,
-			Acl addAces, Acl removeAces, ExtensionsData extension) {
+    public String createPolicy(String repositoryId, Properties properties, String folderId, List<String> policies,
+            Acl addAces, Acl removeAces, ExtensionsData extension) {
 
-		return fObjSvc.createPolicy(fDummyCallContext, repositoryId, properties, folderId, policies, addAces,
-				removeAces, extension);
-	}
+        return fObjSvc.createPolicy(fDummyCallContext, repositoryId, properties, folderId, policies, addAces,
+                removeAces, extension);
+    }
 
-	public String createRelationship(String repositoryId, Properties properties, List<String> policies, Acl addAces,
-			Acl removeAces, ExtensionsData extension) {
+    public String createRelationship(String repositoryId, Properties properties, List<String> policies, Acl addAces,
+            Acl removeAces, ExtensionsData extension) {
 
-		return fObjSvc.createRelationship(fDummyCallContext, repositoryId, properties, policies, addAces, removeAces,
-				extension);
-	}
+        return fObjSvc.createRelationship(fDummyCallContext, repositoryId, properties, policies, addAces, removeAces,
+                extension);
+    }
 
-	public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
-			ExtensionsData extension) {
+    public void deleteContentStream(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+            ExtensionsData extension) {
 
-		fObjSvc.deleteContentStream(fDummyCallContext, repositoryId, objectId, changeToken, extension);
-	}
+        fObjSvc.deleteContentStream(fDummyCallContext, repositoryId, objectId, changeToken, extension);
+    }
 
-	public void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
+    public void deleteObject(String repositoryId, String objectId, Boolean allVersions, ExtensionsData extension) {
 
-		fObjSvc.deleteObjectOrCancelCheckOut(fDummyCallContext, repositoryId, objectId, allVersions, extension);
-	}
+        fObjSvc.deleteObjectOrCancelCheckOut(fDummyCallContext, repositoryId, objectId, allVersions, extension);
+    }
 
-	public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
-			UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
+    public FailedToDeleteData deleteTree(String repositoryId, String folderId, Boolean allVersions,
+            UnfileObject unfileObjects, Boolean continueOnFailure, ExtensionsData extension) {
 
-		return fObjSvc.deleteTree(fDummyCallContext, repositoryId, folderId, allVersions, unfileObjects,
-				continueOnFailure, extension);
-	}
+        return fObjSvc.deleteTree(fDummyCallContext, repositoryId, folderId, allVersions, unfileObjects,
+                continueOnFailure, extension);
+    }
 
-	public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
+    public AllowableActions getAllowableActions(String repositoryId, String objectId, ExtensionsData extension) {
 
-		return fObjSvc.getAllowableActions(fDummyCallContext, repositoryId, objectId, extension);
-	}
+        return fObjSvc.getAllowableActions(fDummyCallContext, repositoryId, objectId, extension);
+    }
 
-	public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
-			BigInteger length, ExtensionsData extension) {
+    public ContentStream getContentStream(String repositoryId, String objectId, String streamId, BigInteger offset,
+            BigInteger length, ExtensionsData extension) {
 
-		return fObjSvc.getContentStream(fDummyCallContext, repositoryId, objectId, streamId, offset, length, extension);
-	}
+        return fObjSvc.getContentStream(fDummyCallContext, repositoryId, objectId, streamId, offset, length, extension);
+    }
 
-	public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
-			IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
-			Boolean includeAcl, ExtensionsData extension) {
+    public ObjectData getObject(String repositoryId, String objectId, String filter, Boolean includeAllowableActions,
+            IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+            Boolean includeAcl, ExtensionsData extension) {
 
-		return fObjSvc.getObject(fDummyCallContext, repositoryId, objectId, filter, includeAllowableActions,
-				includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
-	}
+        return fObjSvc.getObject(fDummyCallContext, repositoryId, objectId, filter, includeAllowableActions,
+                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
+    }
 
-	public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
-			IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
-			Boolean includeAcl, ExtensionsData extension) {
+    public ObjectData getObjectByPath(String repositoryId, String path, String filter, Boolean includeAllowableActions,
+            IncludeRelationships includeRelationships, String renditionFilter, Boolean includePolicyIds,
+            Boolean includeAcl, ExtensionsData extension) {
 
-		return fObjSvc.getObjectByPath(fDummyCallContext, repositoryId, path, filter, includeAllowableActions,
-				includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
-	}
+        return fObjSvc.getObjectByPath(fDummyCallContext, repositoryId, path, filter, includeAllowableActions,
+                includeRelationships, renditionFilter, includePolicyIds, includeAcl, extension, null);
+    }
 
-	public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
+    public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension) {
 
-		return fObjSvc.getProperties(fDummyCallContext, repositoryId, objectId, filter, extension);
-	}
+        return fObjSvc.getProperties(fDummyCallContext, repositoryId, objectId, filter, extension);
+    }
 
-	public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
-			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+    public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
+            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
 
-		return fObjSvc.getRenditions(fDummyCallContext, repositoryId, objectId, renditionFilter, maxItems, skipCount,
-				extension);
-	}
+        return fObjSvc.getRenditions(fDummyCallContext, repositoryId, objectId, renditionFilter, maxItems, skipCount,
+                extension);
+    }
 
-	public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
-			ExtensionsData extension) {
+    public void moveObject(String repositoryId, Holder<String> objectId, String targetFolderId, String sourceFolderId,
+            ExtensionsData extension) {
 
-		fObjSvc.moveObject(fDummyCallContext, repositoryId, objectId, targetFolderId, sourceFolderId, extension, null);
-	}
+        fObjSvc.moveObject(fDummyCallContext, repositoryId, objectId, targetFolderId, sourceFolderId, extension, null);
+    }
 
-	public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
-			Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
+    public void setContentStream(String repositoryId, Holder<String> objectId, Boolean overwriteFlag,
+            Holder<String> changeToken, ContentStream contentStream, ExtensionsData extension) {
 
-		fObjSvc.setContentStream(fDummyCallContext, repositoryId, objectId, overwriteFlag, changeToken, contentStream,
-				extension);
-	}
+        fObjSvc.setContentStream(fDummyCallContext, repositoryId, objectId, overwriteFlag, changeToken, contentStream,
+                extension);
+    }
 
-	public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
-			Properties properties, ExtensionsData extension) {
+    public void updateProperties(String repositoryId, Holder<String> objectId, Holder<String> changeToken,
+            Properties properties, ExtensionsData extension) {
 
-		fObjSvc.updateProperties(fDummyCallContext, repositoryId, objectId, changeToken, properties, null, extension,
-				null);
-	}
+        fObjSvc.updateProperties(fDummyCallContext, repositoryId, objectId, changeToken, properties, null, extension,
+                null);
+    }
 
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java?rev=936938&r1=936937&r2=936938&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/clientprovider/RepositoryServiceImpl.java Thu Apr 22 16:27:57 2010
@@ -37,80 +37,80 @@ import org.apache.chemistry.opencmis.inm
  */
 public class RepositoryServiceImpl extends AbstractService implements RepositoryService {
 
-	private InMemoryRepositoryServiceImpl fRepSvc;
+    private InMemoryRepositoryServiceImpl fRepSvc;
 
-	/**
-	 * Constructor.
-	 */
-	public RepositoryServiceImpl(InMemoryRepositoryServiceImpl repSvc) {
-		fRepSvc = repSvc;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfo
-	 * (java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
-	 */
-	public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
-
-		return fRepSvc.getRepositoryInfo(fDummyCallContext, repositoryId, extension);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos
-	 * (boolean, org.apache.opencmis.client.provider.ExtensionsData)
-	 */
-	public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
-		return fRepSvc.getRepositoryInfos(fDummyCallContext, extension);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.RepositoryService#getTypeChildren
-	 * (java.lang.String, java.lang.String, java.lang.Boolean,
-	 * java.math.BigInteger, java.math.BigInteger,
-	 * org.apache.opencmis.client.provider.ExtensionsData)
-	 */
-	public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
-			BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
-
-		return fRepSvc.getTypeChildren(fDummyCallContext, repositoryId, typeId, includePropertyDefinitions, maxItems,
-				skipCount, extension);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.RepositoryService#getTypeDefinition
-	 * (java.lang.String, java.lang.String,
-	 * org.apache.opencmis.client.provider.ExtensionsData)
-	 */
-	public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
-
-		return fRepSvc.getTypeDefinition(fDummyCallContext, repositoryId, typeId, extension);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.apache.opencmis.client.provider.RepositoryService#getTypeDescendants
-	 * (java.lang.String, java.lang.String, java.math.BigInteger,
-	 * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
-	 */
-	public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
-			Boolean includePropertyDefinitions, ExtensionsData extension) {
-
-		return fRepSvc.getTypeDescendants(fDummyCallContext, repositoryId, typeId, depth, includePropertyDefinitions,
-				extension);
-	}
+    /**
+     * Constructor.
+     */
+    public RepositoryServiceImpl(InMemoryRepositoryServiceImpl repSvc) {
+        fRepSvc = repSvc;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfo
+     * (java.lang.String, org.apache.opencmis.client.provider.ExtensionsData)
+     */
+    public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) {
+
+        return fRepSvc.getRepositoryInfo(fDummyCallContext, repositoryId, extension);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.RepositoryService#getRepositoryInfos
+     * (boolean, org.apache.opencmis.client.provider.ExtensionsData)
+     */
+    public List<RepositoryInfo> getRepositoryInfos(ExtensionsData extension) {
+        return fRepSvc.getRepositoryInfos(fDummyCallContext, extension);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.RepositoryService#getTypeChildren
+     * (java.lang.String, java.lang.String, java.lang.Boolean,
+     * java.math.BigInteger, java.math.BigInteger,
+     * org.apache.opencmis.client.provider.ExtensionsData)
+     */
+    public TypeDefinitionList getTypeChildren(String repositoryId, String typeId, Boolean includePropertyDefinitions,
+            BigInteger maxItems, BigInteger skipCount, ExtensionsData extension) {
+
+        return fRepSvc.getTypeChildren(fDummyCallContext, repositoryId, typeId, includePropertyDefinitions, maxItems,
+                skipCount, extension);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.RepositoryService#getTypeDefinition
+     * (java.lang.String, java.lang.String,
+     * org.apache.opencmis.client.provider.ExtensionsData)
+     */
+    public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) {
+
+        return fRepSvc.getTypeDefinition(fDummyCallContext, repositoryId, typeId, extension);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.opencmis.client.provider.RepositoryService#getTypeDescendants
+     * (java.lang.String, java.lang.String, java.math.BigInteger,
+     * java.lang.Boolean, org.apache.opencmis.client.provider.ExtensionsData)
+     */
+    public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth,
+            Boolean includePropertyDefinitions, ExtensionsData extension) {
+
+        return fRepSvc.getTypeDescendants(fDummyCallContext, repositoryId, typeId, depth, includePropertyDefinitions,
+                extension);
+    }
 
 }



Mime
View raw message