Commit Graph

504 Commits

Author SHA1 Message Date
Blake Watters
4eb765aad8 Switch to %ld and cast counts to long to suppress warnings on OS X 2012-11-29 00:21:56 -05:00
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
0aeb5f6de4 Restore paginator integration in Object Manager 2012-11-19 12:01:07 -05:00
Blake Watters
9d14bfe395 Rev docs for willMapDeserializedResponseBlock. refs #900 2012-11-18 22:54:05 -05:00
Blake Watters
61f0817776 Update docs regarding error behavior in the event nil is returned by the willMapDeserializedResponse block. closes #900 2012-11-18 22:50:56 -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
e088bdc186 When managedObjectContext is set to nil on RKManagedObjectRequestOperation, avoid creation of an orphaned privateContext 2012-11-09 11:05:26 -05:00
Blake Watters
c5cdff950f Add NSParameterAssert guards for getObject:, postObject:, putObject:, patchObject:, and deleteObject: 2012-11-09 10:53:49 -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
b723788fce Style touch-up 2012-11-08 19:31:38 -05:00
Jeff Arena
129cc6f052 Fix issue with cross-context object comparison in case of local deletes. 2012-11-08 14:24:24 -05:00
Jeff Arena
9d40138129 Change the default value for deletesOrphanedObjects to YES in RKManagedObjectRequestOperation 2012-11-08 13:58:10 -05:00
Blake Watters
e85cf659c0 Improve Request Descriptor registration and lookup behaviors:
* Add assertion to object manager when you attempt to register an overlapping request descriptor
* Improve search algorithm to handle subclass matches
2012-11-05 23:10:57 -05:00
Blake Watters
28c8262b0d Port commented out unit tests from 0.10.x to latest development sources to nail down issues with targetObject behaviors 2012-11-05 18:38:24 -05:00
Blake Watters
e7505df56c Fix retain cycles detected by Xcode 4.6 static analyzer 2012-11-05 18:38:23 -05:00
Jeff Arena
2612604df3 Fix accept header issue with multipart requests. 2012-11-03 11:37:54 -04:00
Blake Watters
94318d1cb2 Add support for returning fetched objects when a 304 'Not Modified' response is loaded. closes #1006 2012-10-28 21:44:42 -04:00
Blake Watters
5cab23b3af Fix autoreleasepool error under iOS 5.x. fixes #1008 2012-10-28 20:32:10 -04:00
Blake Watters
de016e22f3 Refetch the mapping results from the original managed object context before returning to the caller. fixes #1011
Eliminate the thread safe invocation class.
2012-10-28 20:22:53 -04:00
Blake Watters
337d078942 nil out the mapping result in the event we have encountered an error 2012-10-28 19:39:14 -04:00
Blake Watters
d71893bf43 Remove errantly committed logging statement 2012-10-27 18:08:15 -04:00
Blake Watters
9fa32fb08c Formatting tweak 2012-10-27 17:48:00 -04:00
Blake Watters
e457aba0fa Fix issue with nil arguments to success/failure block introduced earlier today 2012-10-27 16:41:46 -04:00
Blake Watters
a3bef1699a Add missing assert message 2012-10-27 16:21:13 -04:00
Blake Watters
29fecfd8bc Drop GG prefix in examples in header 2012-10-27 16:20:55 -04:00
Blake Watters
d2dc222766 FIx inappropriate use of __block when we mean __weak 2012-10-27 10:25:14 -04:00
Blake Watters
a484af05f5 Update logger to display basic info about an input stream used to send a request instead of wrongly logging request.body=(null) 2012-10-25 13:18:01 -04:00
Blake Watters
9ef8be412e Update docs to include note about setHTTPOperationClass: 2012-10-25 10:07:14 -04:00
Blake Watters
4a79ab6b68 Conditionalize log message regarding awaiting execution of connection operations and move to Trace logging level 2012-10-23 11:18:45 -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
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
c7ce86e9ac Improve docs on success/failure blocks 2012-10-20 10:51:49 -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
0738f59231 Added assertion to trap very nasty Core Data mapping error in which existingObjectWithID:error: returns an object in another context, indicating that the object graph has been poisoned, most likely by obtaining a permanent managed object ID from the wrong context. 2012-10-19 17:53:09 -04:00
Blake Watters
f69c2976e2 Fix bug with dynamic parameterization when the concrete mapping includes a date.
Instead of relying on reference to the RKMapping, which could be dynamic, traverse from the attribute mapping back to its parent to obtain the appropraite date formatter.
2012-10-18 14:38:36 -04:00
Blake Watters
384ff80845 Add support for spinning the Network Activity Indicator while object request operations are executing. Add notifications for tracking object request operation lifecycle. 2012-10-17 22:35:13 -04:00
Blake Watters
68cebc96af Added convenience function for getting a fetch request from an array of fetch request blocks 2012-10-17 22:34:09 -04:00
Blake Watters
feb998ea84 Added support for truncating the length of logged request and response bodies via the 'RKLogMaxLength' environment variable to avoid getting hammered with output on the Trace level 2012-10-17 22:33:31 -04:00
Blake Watters
f2bc809502 Update to reflect change to designated initializer in superclass preventing the appropriate default value for savesToPersistentStore: to be set. refs #1000 2012-10-17 17:08:31 -04:00
Blake Watters
bc50e95036 Fix invalid references to requestOperation. refs #997 2012-10-16 11:59:39 -04:00
Blake Watters
f4bfdb389b Add support for the registration of HTTP request operation subclasses on the manager to support easy customization of request operation handling. refs #997 2012-10-16 11:25:00 -04:00
Blake Watters
d6c429e735 Add tests clarifying issue regarding relativePath vs. relativeString. closes #996 2012-10-15 23:22:27 -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
342c57213b Updates to relationship connection execution system for better encapsulation and reuse.
* Reworked execution of relationship connection operations to use dependencies instead of queue suspension.
* Migrates responsibility for connecting relationships from `RKManagedObjectRequestOperation` into `RKManagedObjectResponseMapperOperation`. This ensures that you get a mapped and connected object graph back from the response mapper if you are using it outside of a request operation.
* Add `parentOperation` to managed object mapping data source to establish dependencies.
2012-10-15 16:06:22 -04:00
Blake Watters
1811d5250d Ensure the fetch request blocks are given a relative URL if possible to make path matching easier 2012-10-14 16:03:12 -04:00
Blake Watters
4ee29df72f Ensure cancellation works with path patterns against baseURL's that include a path 2012-10-14 15:32:08 -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
3cc5ab9825 Fix inappropriate logging message regarding redirects 2012-10-14 13:51:38 -04:00
Blake Watters
8ae402e297 Add test coverage and fixed invalid error reporting when processing a client error that is empty and unmappable (i.e. {}). refs #983, closes #978 2012-10-06 01:54:12 -04:00