Commit Graph

77 Commits

Author SHA1 Message Date
emil.wojtaszek
de5b7111a1 bug fix with wrong path to data store on mac 2011-08-25 20:38:33 -04:00
Blake Watters
272b161732 Fix incorrect import causing build breakage. fixes #299 2011-08-15 08:02:14 -04:00
Blake Watters
2e430644d9 Added support for using NSEntityDescription to lookup property types for NSManagedObject attribute and relationships. This enables mapping type transformations on mappings defined against Core Data entities instead of concrete subclasses. fixes #233 2011-08-14 23:21:51 -04:00
Blake Watters
4e03ba7bef Renamed Polymorphic mapping to dynamic mapping after consulting with the community. Dropped abstract superclass in favor of a RKObjectMappingDefinition protocol. Caught missing cases with dynamic object mapping + targetObject. Updated docs and method signatures to reflect the updates. 2011-07-31 19:37:42 -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
Blake Watters
d12568580d Merge pull request #234 from GateGuru/unit-testing-and-queue-fixes
Unit testing and queue fixes
2011-07-22 05:15:01 -07: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
7246afc998 Fixes to enable RestKit Core Data to be easily unit tested from a Unit Testing bundle. Improved thread safety in the request queue and fixed an issue where requests dispatched from background threads would not get callback methods due to thread termination. The request queue now guarantees requests are sent from the main thread. 2011-07-21 11:33:17 -04:00
Blake Watters
40eb842dcc Store new objects by lookupValue instead of primaryKeyValue. This avoids creation of duplicated objects the are manufactured by findOrCreateInstanceOfEntity: 2011-07-07 22:40:46 -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
e86507f4ed Bug fix for potential invocation of setObject:forKey: with a nil key value 2011-07-05 16:30:16 -04:00
Blake Watters
f0e8e8d44f Coerce primary keys to strings in the thread-local lookup cache to handle lookups for numeric or string keys coming back in the JSON 2011-07-02 15:03:08 -04:00
Blake Watters
72f26690ed Fixing crash from over-release of RKParams. 2011-06-30 17:19:12 -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
d57b784c30 Don't delete the managed object unless we were responsible for saving it in the first place. closes #125 2011-06-29 21:04:17 -04:00
Blake Watters
2a8ece97c1 Improvements to reachability, the request queue, logging throughout the network layer, decoupling of components via notifications, reliability improvements for unit tests in the cache layer. Improved thread-local cleanup routines inside the managed object store. Changing base URL's is now more reliable. fixes #171, #158, #113, #104, #102 2011-06-29 13:28:14 -04:00
Blake Watters
3dfbaf1810 Updated to support setting default value instead of nil when an attribute is missing in the payload. For Core Data backed models, we consult the entity definition to obtain the default value. closes #117 2011-06-28 15:22:04 -04:00
Blake Watters
e4320f7ea9 Added error reporting when RKManagedObjectLoader fails to save the object context. This was silently masking validation failures post-mapping. 2011-06-24 15:59:40 -04:00
Blake Watters
4773542a9e Fix breakage in Core Data 2011-06-23 09:21:54 -04:00
Blake Watters
1ab61ad735 Check for nil target object ID before performing deletion. Log info about the process. 2011-06-21 10:13:34 -04:00
Jeremy Ellison
a5cc456351 Merge branch 'restkit-sprint' of github.com:twotoasters/RestKit into restkit-sprint 2011-06-20 10:51:30 -04:00
Jeremy Ellison
de154e21b8 Fix -reset in RKManagedObjectLoader.m 2011-06-20 10:50:56 -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
Daniel Hammond
e9e4c83630 Merge branch 'restkit-sprint' of github.com:twotoasters/RestKit into restkit-sprint 2011-06-16 21:17:31 -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
Duncan Lewis
ed9260abcd Issue #106 added requested change in RKManagedObjectStore.m 2011-06-16 18:47:42 -04:00
Duncan Lewis
61de21f0d1 Applied fix for RestKit issue #89 2011-06-16 18:29:21 -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
Blake Watters
e5093a38dd Merge pull request #83 from sixten/0.9-error-handling 2011-05-10 17:58:46 -07:00
Greg Combs
d780586da4 Deleting persistent store will now permit using a store seed. 2011-05-01 20:49:32 -05:00
Sixten Otto
40c4940ea6 Minor improvements to error handling behavior 2011-04-28 10:38:08 -07:00
Blake Watters
308b6c5dd2 Updates to RKObjectLoader to fix issues where keyPath was not always respected and willSendForObjectLoader: not invoked as expected. Expanded spec coverage to fix these issues. fixes #80, fixes #81 2011-04-28 00:05:55 -04:00
Blake Watters
9af6a59c79 Initial implementation of documentation generation using the Appledoc parser. refs #48
* Cleaned up various mismatches in method signatures that were preventing documentation generation
* Removed naked ampersands from comments as they cause XML parser failures during docset generation via appledoc
2011-04-14 22:55:58 -04:00
Blake Watters
9593612aab Closes gh-47. Initial implementation of OS X build integrating changes submitted by Felix Holmgren (https://github.com/Felixyz/RestKit).
* Factored out display of alerts into RKAlert interface that hides the differences between UIKit and OS X Cocoa.
* Added macosx to supported platforms to enable build on OS X.
* Configured project to use conditional architectures to enable building on OS X and iOS from the same targets.
* Implemented a bare-bones OS X example app.
* Create `rake build` task for building RestKit against iOS and OS X SDK for quick testing.
2011-04-12 21:02:25 -04:00
Sixten Otto
cef335d02b Allow storage in non-Documents directories
Add a new class method that takes a directory parameter, and add a corresponding parameter to the private initializer. The other class methods pass nil for that new parameter. The value for the pathToStoreFile property is now calculated in the initializer, and stored in an instance variable.
2011-04-12 20:02:48 -04:00
Sixten Otto
ecb0a5bd5e Improve RKManagedObjectStore's error handling
Add RKManagedObjectStoreDelegate protocol and a delegate property. Right now, all of the notifications are of errors/failures. Some code has been restructured so that return values are always consulted BEFORE the error parameter is examined.
2011-04-12 20:02:37 -04:00
Peter Marks
35171084d1 [Story #11961455] Implements support for sending nested objects back to the remote server for processing:
* Introduce RKObjectMappable#relationshipsToSerialize to define nested relationships to post
* New helper methods for working with relationship serializations.
* Extended Rails router to serialize nested objects according to Rails idioms
2011-04-05 22:18:10 -04:00
Blake Watters
5411f54d02 Implemented lightweight authentication scheme setup. Enables HTTP Digest AUTH 2011-03-27 01:19:37 -04:00
Blake Watters
52b2f9ffcb Fix for usage of models instead of objects dictionary key 2011-03-21 19:54:46 -04:00
Blake Watters
2109fae1ba Finished cleaning up Core Data support. Happy with the new organization 2011-03-19 22:06:51 -04:00
Blake Watters
58f867160f Remove old object seeder 2011-03-19 21:35:03 -04:00
Blake Watters
88a1b013fc Merge remote branch 'origin/0.9' into core-data-cleanup
Conflicts:
	Code/CoreData/CoreData.h
	Code/CoreData/RKManagedObjectStore.h
	Code/CoreData/RKManagedObjectStore.m
	Code/CoreData/RKObjectSeeder.h
	Code/CoreData/RKObjectSeeder.m
	Code/ObjectMapping/RKObjectLoader.m
	Code/ObjectMapping/RKObjectManager.m
	Code/ObjectMapping/RKObjectMapper.m
	RestKit.xcodeproj/project.pbxproj
2011-03-19 21:26:13 -04:00
Blake Watters
a94456a01e Committing changes to sync against 0.9 2011-03-19 20:59:54 -04:00
Blake Watters
52ca8588cf Use removeObjectForKey on deletePersistantStore. 2011-03-09 22:03:18 -05:00
Blake Watters
3cf66e5385 More improvements to the managed object store and seeding API's 2011-03-05 17:05:31 -05:00
Blake Watters
1405c0b404 Overhauled the object seeder API. It's much cleaner. Added example code to the RKTwitterCoreDataExample 2011-03-05 16:11:00 -05:00
Blake Watters
6c351c1ef9 Merge branch 'updates' of https://github.com/ahinz/RestKit into seeding
Conflicts:
	Code/CoreData/RKManagedObjectStore.h
	Code/CoreData/RKManagedObjectStore.m
2011-03-05 13:06:21 -05:00