Commit Graph

467 Commits

Author SHA1 Message Date
Blake Watters
8dc54a89b2 Major overhaul to the Core Data managed object identification and relationship connection support.
* Replaces primary key with `RKEntityIdentifier`
* Add support for use of compound keys for object identification
* Refactor `RKConnectionMapping` to `RKConnectionDescription` and add support for connecting with multiple attributes
* Clarify naming of representation key methods to better match naming conventions
* Add type transformation support for object identification
* Greatly expand test coverage for object identification
* Drop the `NSEntityDescription` category
* Simplify the `RKManagedObjectCaching` protocol
* Add compound key support to the Fetch Request and In Memory Cache implementations
* Replace Kiwi with Specta for tests where contexts are helpful for organization
* Rename `defaultValueForMissingAttribute` to `defaultValueForAttribute`
2012-11-27 10:29:36 -05:00
Blake Watters
7888a55f6c Remove the ignoreUnknownKeyPaths option. closes #840 2012-11-19 19:21:24 -05:00
Blake Watters
36c60608b2 Add support for transforming source to destination key paths using a block. This enables one to DRY up mapping configuration. 2012-11-19 18:53:13 -05:00
Blake Watters
54dce20ac6 Rework paginator support for 0.20. closes #1024, #900, #759
* Renamed RKObjectPaginator to RKPaginator for simplicity
* Removed delegate on paginator in favor of simple success/failure blocks
* Added `willMapDeserializedResponseBlock` for manipulating the response body before mapping begins
* Added support for cancelling an in-progress pagination request
2012-11-18 22:44:33 -05:00
Blake Watters
7d9087b722 Supress extraneous logging when type is transformed to nil 2012-11-09 12:12:42 -05:00
Blake Watters
e109036683 Add support and test coverage for serializing Boolean properties to JSON as true/false instead of numbers. closes #920, #827 2012-11-08 23:41:19 -05:00
Blake Watters
3db5307f6a Add missing test coverage for key path based connection scenarios. Fixes crashes resulting from double collection wrapping during connection. 2012-11-08 19:31:38 -05:00
Blake Watters
f2ff70177c Merge branch 'development' of github.com:CFKevinRef/RestKit into CFKevinRef-development 2012-11-07 21:59:38 -05:00
Blake Watters
d689ba9291 Add support for mapping to NSData attributes using a NSKeyedArchiver. closes #910 2012-11-07 11:00:15 -05:00
Blake Watters
45c6e1611e Add delegate for didFailToConnectRelationship: 2012-11-05 18:38:23 -05:00
Kevin Cassidy
f049f5f998 Take KVC scalar/structure support and NSAttributeType into account when inspecting properties. 2012-11-05 11:55:12 -05:00
Blake Watters
454eb2e8fa Correct usage of 'method' instead of 'function' in comment 2012-10-28 19:40:22 -04:00
Jeff Arena
37ae82c695 Add additional default date formatter to handle rails dates. 2012-10-24 13:23:54 -04:00
Blake Watters
f96fee87b6 Add a decent description method to the object request operations 2012-10-22 19:29:58 -04:00
Blake Watters
a267f5ac71 Drop extraneous space between class and object address in property description 2012-10-21 16:16:04 -04:00
Blake Watters
117fcbb18c Fix horrible bugs in previous commit 2012-10-21 15:58:03 -04:00
Blake Watters
f93a044561 Add error condition when attempting to map an RKEntityMapping containing connection mappings with a nil managed object cache.
* Add support for the data source to fail mapping operation with an error.
* Clean up error handling within RKMappingOperation
2012-10-21 15:47:16 -04:00
Blake Watters
ef46ff2d1d Add assertion that gives the developer a hint of how to fix an attempt to add an array of attribute mappings that already exist in another mapping 2012-10-20 17:43:49 -04:00
Blake Watters
63c9a9e4a0 Fix bug in which relationship connection operations are not enqueued for RKMappingOperation instances whose mapping is an RKDynamicMapping 2012-10-20 16:53:14 -04:00
Blake Watters
08110ca300 Implement support for cancellation and prioritization of response mapping operations using an operation queue global to all object request operations.
* Passes through cancellation from object request operation to HTTP request operation and response mapping operation. closes #993
* Performs all object mapping within an NSOperationQueue to enable constraining of mapping activities.
* Add default mapping queue with concurrency limit of 1 operation.
* Migrate deserialization of the response body into a serial dispatch queue to ensure that only one parse occurs at a time.
2012-10-20 00:13:48 -04:00
Blake Watters
639897dd67 Refactored relationship mapping implementation to make it easier to follow and debug 2012-10-19 17:53:09 -04:00
Blake Watters
316d2c1316 Improve assertion error message 2012-10-18 17:19:48 -04:00
Blake Watters
e748e5bfce Don't throw an exception if doing a simple attribute mapping with a nil data source. closes #1005 2012-10-18 15:17:57 -04:00
Blake Watters
5684f7ab89 Add objectMapping identity attribute on RKPropertyMapping to allow one to traverse the mapping graph from an attribute/relationship back to the parent mapping 2012-10-18 14:37:52 -04:00
Blake Watters
e8b4cdd19c DRY up find or create of destination object within the mapping operation and change nil destination object to an error condition instead of an assertion. 2012-10-18 14:06:46 -04:00
Blake Watters
fb6db948e1 Implement support for using dynamic mapping during parameterization with a Request Descriptor. closes #684 2012-10-18 12:14:16 -04:00
Blake Watters
20c4121644 Improve logging when mapping a null relationship value. refs #862 2012-10-16 20:50:35 -04:00
Blake Watters
9d617c6c7b Add support for disconnecting relationships when mapping a related keypath whose value is equal to [NSNull null]. fixes #862 2012-10-16 20:48:27 -04:00
Jeff Arena
53f4105e57 Split out simple and keyPath attribute mappings to allow relationship mappings to run before keyPath mappings. 2012-10-16 18:07:36 -04:00
Blake Watters
64e9c7cb6d Add support for mapping attributes to deeply nested keyPaths on NSMutableDictionary. fixes #882 2012-10-15 22:00:14 -04:00
Blake Watters
74624200da Fix inappropriate override of start method in RKMappingOperation. This should be main, as we are not concurrent 2012-10-15 18:41:45 -04:00
Blake Watters
d823217993 Add assertions to prevent attempts to create request descriptor objects with inappropriate mappings. fixes #976 2012-10-14 14:57:02 -04:00
Blake Watters
f3ece00743 Rework path based response descriptor matching and expand test coverage. Eliminate path normalization. fixes #987 2012-10-14 13:51:39 -04:00
Blake Watters
4a7ed3cbd3 Rename test files to align with classes 2012-10-14 13:51:39 -04:00
Blake Watters
564749c2b9 Document cache HTTP methods 2012-10-05 19:21:18 -04:00
Blake Watters
877ce255b5 Expand test coverage and fix situations where requests would unexpectedly initialize incorrectly without error
* RKObjectParameterization now returns an empty dictionary if mapping produces an unmappable representation error (no mappable attributes/relationships found)
* Log errors if request construction results in an NSError and return nil
* Ensure errors are passed back up through object parameterization instead of just returning nil
* Reset the serialization MIME Type registry during RKTestFactory set up to ensure it is in a sane state
* Convert Hamcrest matchers to Expecta in the object mapper tests to fix infinite recursion on test failure (will need to completely phase out Hamcrest soon)
2012-10-05 19:16:55 -04:00
Blake Watters
61a0a05b29 Drop ISO8601DateFormatter dependency since it has a time zone handling bug and switch to RK specific fork. fixes #971
* ARCify the ISO8601DateFormatter
2012-10-04 23:00:01 -04:00
Dmitry Shevchenko
a41f69ee5e Fixed RKObjectMapping copying 2012-10-01 16:47:17 -05:00
Blake Watters
67e6982cec Fix invalid references to RKManagedObjectMapping. closes #957 2012-09-30 23:17:27 -04:00
Blake Watters
d95fe5cd44 Break out reused functions for object mapping introspection into RKObjectUtilities 2012-09-30 12:49:59 -04:00
Blake Watters
4c401de6bf Convert RKConnectionMapping into a subclass of RKPropertyMapping. Add delegate callback for tracking the connection of relationships. 2012-09-29 17:54:51 -04:00
Blake Watters
ecb6af4776 Factor date formatting into reusable convenience functions 2012-09-28 14:59:57 -04:00
Arne Harren
bc7c65f03b Switch to an embedded variant of LibComponentLogging with prefix RK 2012-09-27 21:47:36 +02:00
Blake Watters
fee0c0dac0 Fix all remaining broken tests 2012-09-25 21:18:39 -04:00
Blake Watters
e56754cb65 Add support for mapping of numeric dates encoded in strings via NSNumberFormatter. closes #815 2012-09-25 21:18:03 -04:00
Blake Watters
c6b594e93a Fix exception that occurs when attempting to build an RKMappingResult after an attempt has been made to map a non-nil, empty response object (such as {}) 2012-09-25 11:59:28 -04:00
Blake Watters
c9249bf0dc Cleanup accidentally committed empty method 2012-09-24 22:45:55 -04:00
Blake Watters
235f5fc579 Fix all build errors in unit tests. Restore execution of core mapping tests. 2012-09-24 22:44:20 -04:00
Blake Watters
b0be4596da Formatting cleanups 2012-09-24 13:37:54 -04:00
Blake Watters
654364af61 Document RKDynamicMappingMatcher and clean up API 2012-09-21 22:59:43 -04:00