Blake Watters
4b46ada794
Copy the error mapping to the temporary mapping provider to ensure error handling is correct.
2012-01-20 10:21:56 -05:00
Blake Watters
1d27f7bbbe
Refactored object manager API's to de-emphasize delegates and removal duplication of blocks and delegates. Added block callbacks to RKObjectLoader.
2012-01-20 10:21:56 -05:00
Blake Watters
4bd12ea987
Apply rootKeyPath within the mapper rather than the object loader
2012-01-20 10:21:19 -05:00
Blake Watters
7c5ad95816
Updated all example projects to reflect changes.
2012-01-20 10:21:19 -05:00
Blake Watters
7a1dfd0857
Added support for selecting object mapping using pattern matching on resourcePath.
2012-01-20 10:21:19 -05:00
Blake Watters
6abbb34ef0
Introduced mapping contexts support.
...
Extended RKObjectMappingProvider to store collections of object mappings for different use cases. The framework
now stores object mappings, serialization mappings, an error mapping and a pagination mapping using the context
support. Contexts can be added to the provider via method calls or extension via a category.
2012-01-20 10:21:19 -05:00
Blake Watters
412b0f9756
Work in progress on cleanup
2012-01-20 10:21:18 -05:00
Ray Fix
ab3ec5495f
Leaks brought to my attention by the static analyzer.
2012-01-20 10:21:18 -05:00
Blake Watters
fb41eb73ec
Work in progress on responsibility cleanup
2012-01-20 10:21:18 -05:00
Blake Watters
254553dc7c
Initial implementation of RKObjectPaginator
2012-01-20 10:21:18 -05:00
Blake Watters
4d99d28a4d
Merge pull request #477 from rayfix/fix-log-root-key-path
...
Fixed logging of root key path on object mapping. Remove TODO comment.
2011-12-16 21:23:21 -08:00
chethan
ea0cbed8dc
Fixed logging of root key path on object mapping. Remove TODO comment that is done.
2011-12-16 18:20:24 -08:00
Julien Grimault
a1e2061106
Modified asserts in RKObjectLoader processMappingResult to allow synchronous requests.
2011-12-13 20:58:15 -05:00
Blake Watters
479864902b
Fixed all build warnings on OS X Framework target
2011-12-08 23:23:20 -05:00
Blake Watters
8a39f93e62
Add support for handling 204 'No Content' responses. fixes #450
2011-12-02 09:27:22 -05:00
Blake Watters
563f5e909b
Updated all example projects to build against the new project. Cleaned up header imports for flattened project structure
2011-12-02 09:26:36 -05:00
Blake Watters
4b1db7a6f1
Improve assertion failure message when no serialization mapping is available and a put/postObject is attempted
2011-10-11 21:40:26 -04:00
Blake Watters
4b287a5b24
Added ability to overload the params on object loaders composed by the object manager. fixes #352
2011-09-19 19:54:58 -04:00
Parker
99250475ad
added Apache License headers to all files in ObjectMapping directory
2011-09-07 11:31:01 -04:00
Blake Watters
4299cab994
Added convenience accessors on RKObjectManager for the requestCache and requestQueue. Cleaned up some styling and normalized method names.
2011-09-06 11:36:50 -04:00
Blake Watters
6cc7f1e4d6
Added test coverage for queue loading count being decremented when the response is unmappable. fixes #230 , fixes #286
2011-09-03 17:29:58 -04:00
Blake Watters
84032d9aa6
De-emphasized the use of the sharedQueue and improved management of queue suspension state when changing out the baseURL on RKClient. This should prevent the queue from becoming suspended beyond the life of an RKClient that suspended it. Queues are now also properties on a per-client and per-request basis, so it is easier to segregated parts of your app into different queues. The relationship between RKRequest and RKRequestQueue should be decoupled at some point.
2011-08-18 11:48:37 -04:00
Blake Watters
ca91226129
Fix for incorrect delegate invocation on cache load. fixes #267
2011-08-01 21:54:04 -04:00
Blake Watters
670234b775
Added support for polymorphic object mapping (Github #105 , #244 ). This enables you to dynamically map objects to different destination classes or using different mapping strategies via configuration or callbacks. See Docs/Object Mapping.md for details.
...
Other changes include:
* Eliminated the RKObjectFactory protocol and implementations. Object mapping instances themselves are
now responsible for instantiating target objects for mapping.
* Introduced RKObjectAbstractMapping superclass for RKObjectMapping and RKObjectPolymorphicMapping.
* Updated example applications to use block object loaders (RKTwitter and RKTwitterCoreData)
* Refactored method signatures of RKObjectMapper, RKObjectMapping, and RKObjectMappingProvider to reflect the
existence of abstract mapping types. This was necessary to make polymorphic mappings integrate cleanly.
* Fixed overlap in RestKit error domains between network and object mapping. fixes #208
2011-07-30 16:00:36 -04:00
Rémy SAISSY
2bdf855fbe
finalizeLoad:error: call added in handleResponseError thus avoiding non finalized requests when receiving 40x HTTP response to requests.
2011-07-26 17:45:39 +02:00
Blake Watters
3a5354c4a0
Added specs around behavior of empty mappable payloads and RKObjectLoaderDelegate invocations. Fixed issue where empty hashes ({}) would result in no delegate methods being invoked. fixes #225
2011-07-24 01:25:50 -04:00
Blake Watters
f1b0815e1a
Fixes to some violations of the contracts around delegate methods and background threads
2011-07-21 22:01:47 -04:00
Blake Watters
73fb461a8b
Reworked object mapping behaviors to better accommodate situations where the server side responds with a successful status code and a payload that does not contain any mappable attributes or relationships. We now consider this to be successful. If a mapping operation is performed that does not result in any mappings being applied, it will return NO without setting an error. If an instance of RKObjectMapper is invoked that does not find any mappable content in the payload, this will result in an unmappable content error. The object loader guards against this by not attempting to map any empty payloads. This should ensure that you only get the unmappable content error if you have asked RK to load and map a payload it cannot find an object mapping for.
2011-07-07 09:53:46 -04:00
Blake Watters
c171bed7d3
Don't generate an unmappable content error if a successful status code is returned along with an empty response body. This enables the use of the status code to indicate success without any content for mapping. In these cases, we wrap the targetObject of the loader into a RKObjectMappingResult at the @"" keyPath so that the delegates are invoked as expected. closes #189
2011-07-06 22:01:10 -04:00
Blake Watters
42067b9036
Avoid exception from nil errors during object loader error reporting. fixes #191
2011-07-06 17:04:18 -04:00
Blake Watters
546eb627cd
Respect the root keyPath when constructing a temporary object mapping provider. Covers the case where an object mapping targeting nested content is being directly specified.
2011-07-02 11:04:56 -04:00
Jeremy Ellison
eea75bdb3c
Allow Timeout caching and ETag caching to play nice with each other. Update the internal cache date when we get a 304 back.
2011-06-30 12:54:03 -04:00
Blake Watters
7053a8ca97
Add support for sending objects of one type and getting back another. Target object has been disambiguated into sourceObject and targetObject
...
and act independently with regards to serialization and destination mapping. When you leverage the getObject:mapResponseWith: flavor of methods,
the type of your sourceObject is checked with the destination type of the object mapping. If they agree, it is assumed that you are trying to update
the object with the results of the mapping and targetObject is set appropriately. If they do not match, the targetObject is set to nil so that new
objects will be loaded. closes #161 , #168
2011-06-30 10:33:39 -04:00
Blake Watters
2ac45f5ccc
Refactored object loaders to provide easier support for non-nested JSON responses. There are new flavors of getObject:, postObject:, etc.
...
that allow the developer to explicitly specify the object mapping to use for processing the response. closes #168
2011-06-30 10:33:39 -04:00
Blake Watters
2e7adbdc1e
Restore the managed object cache functionality and add test coverage so it does not break again. fixes #167
2011-06-29 22:08:35 -04:00
Blake Watters
5a2f937a52
Reworked notifications for consistency with Cocoa idioms. Simplified code paths through the queue. Tweaked the logging for easier info at the Debug level without having to drop down to Trace.
2011-06-29 16:18:18 -04:00
Blake Watters
853704b2fd
Rework notifications to allow request queue to observe only the requests it dispatches instead of all of them. Fixes incorrectly decrementing loading count.
2011-06-29 15:36:10 -04:00
Blake Watters
851df3bcba
Changed signature of willMapData: to allow you to completely replace the mappableData.
2011-06-28 11:46:03 -04:00
Blake Watters
0949337749
Allow modification of the data in objectLoader:willMapData: by creating a mutable copy of the parsed data if the delegate method is implemented.
2011-06-27 16:37:55 -04:00
Blake Watters
8ad1a84281
Reworked object loader to check if a response is mappable even if it is an error. We had an assertion failure that could be triggered by trying to load a remote error payload in a non-mappable format (i.e. text/html).
2011-06-21 13:27:15 -04:00
Blake Watters
3204682f72
Added object mapping management to the mapping provider for folks who don't have keyPaths. Deprecated setMapping:forKeyPath: in favor of setObjectMapping:forKeyPath: for consistency with the other method signatures.
2011-06-20 10:49:40 -04:00
Victor Kryukov
00ee7e93c3
Code cleanup: **error may be null as per coding standards in 'Creating and Returning NSError Objects' (found with Analyzer)
2011-06-20 10:49:39 -04:00
Jeremy Ellison
de684989db
Fix memory leaks in -reset on RKObjectLoader and RKManagedObjectLoader.
2011-06-20 09:12:56 -04:00
Daniel Hammond
d9fc311433
Remove objects persisted to Core Dataduring postObject: when there is an error (Fix Issue #125 )
2011-06-16 21:17:14 -04:00
Blake Watters
9299cabc11
Implemented flexible logging solution utilizing the excellent LibComponentLogging library.
2011-06-11 20:25:28 -04:00
Blake Watters
f2ceefa012
Merge Request Queue (See issue #75 ):
...
* Introduces RKRequestCache for cacheing responses (supports ETag conditional GET, use cache if available, use cache on error, etc.) closes #75
* Updates to Three20 layer to eliminate need for intermediary TTTableItem classes closes #76
* Fixes to ensure iOS 3.x compatability:
* Switched compiler to Clang
* Updated conditional checks for UIBackgroundTask symbols to ensure runtime safety on iOS 3.x
* Removed unnecessary linkage against UIKit and CoreFoundation from library targets
* Fix for issue where RKRequest objects could become stuck in infinite loop within RKRequestQueue loadNextInQueue if you start
a request and then cancel immediately. On cancel only decrement loadCount if the request has start loading. refs #122
2011-06-11 19:28:44 -04:00
Blake Watters
f3c0995d5e
Implementation of Object Mapping 2.0 design:
...
* Removed RestKit from inheritance hierarchy
* Mappings are implemented as concrete classes
* Mapper is much more flexible & powerful
* Much more robust error handling
* Serialization is reimplemented as an object mapping operation
* Added ability to serialize to JSON natively
* Reworked Core Data integration
* Simplified the codebase substantially
2011-06-11 19:26:56 -04:00
Pat Shields
eecf87e71a
Don't leak object passed in to loader.
2011-05-27 12:46:36 -04:00
Blake Watters
4321da03b1
Expanded specs and began migrating all the content for testing out in the Fixtures directory. Fixtures is now the root for the Sinatra app and there are new helpers in RKSpecEnvironment.m. Added specs for several users use cases from the mailing list. Introduced a new warning when attempting to map did not set any properties.
2011-05-02 20:57:18 -04:00
Blake Watters
87d0cd13de
Added support for registering object class mappings as keyPaths in addition to element names. closes #82
2011-04-28 13:09:50 -04:00