Commit Graph

47 Commits

Author SHA1 Message Date
Blake Watters
138bbddfcd Switch the default date formatter to ISO-8601. closes #1069, refs #1010 2012-12-11 21:51:53 -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
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
67e6982cec Fix invalid references to RKManagedObjectMapping. closes #957 2012-09-30 23:17:27 -04:00
Blake Watters
ecb6af4776 Factor date formatting into reusable convenience functions 2012-09-28 14:59:57 -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
6815ba6444 API refresh for mapping layer. Converted RKObjectMapper to RKMapperOperation. Expanded documentation. 2012-09-21 17:55:32 -04:00
Blake Watters
f1231cd4aa Docs refresh 2012-09-21 17:55:32 -04:00
Stephan Diederich
89fd9d2b95 fix comments
NSFormatters are prepended to the list, not appended
2012-09-14 16:16:34 +02:00
Jawwad Ahmad
8cbdb5f7ed Trailing whitespace cleanup from files in the Code directory.
Used the following command from within the Code dir:
git ls-files *.m *.h *.json | xargs /usr/bin/sed -i '' -E 's/[[:space:]]*$//'
2012-09-02 12:51:45 -04:00
Blake Watters
2cf16be6cb Add support for performing object mapping with type transformations across relationships defined with keyPaths 2012-08-31 17:47:44 -04:00
Blake Watters
eabfd748b6 Update designated initializer for RKObjectMapping 2012-08-29 18:59:51 -04:00
Blake Watters
ce6b0829e4 Convert RestKit to ARC 2012-08-28 17:34:58 -04:00
Blake Watters
2228cb01bb Drop more mapping convenience methods 2012-08-28 14:23:30 -04:00
Blake Watters
b333e62488 Eliminate and/or depecate numerous mapping API's in favor of simpler usage of attribute, relationship, and connection mappings 2012-08-28 14:14:33 -04:00
Blake Watters
d926e240f8 Introduce RKPropertyMapping abstract superclass for RKAttributeMapping and RKRelationshipMapping.
Add primitives for working with attribute, relationship, and property mapping objects.
2012-08-28 14:14:20 -04:00
Blake Watters
0ff963161f Add addAttributeMappingsFromDictionary: 2012-08-14 09:57:28 -04:00
Blake Watters
a8f64e7982 Continued cleanup related to managed object context work 2012-07-17 13:44:50 -04:00
Blake Watters
b25a1833b3 Ported RestKit to using managed object contexts with concurrency types. Numerous cleanups and API updates. 2012-07-16 22:47:06 -04:00
Blake Watters
f18f9337f3 Added support for comparison of attribute, relationship, and object mappings via isEqualToMapping:. closes #803 2012-07-11 16:16:27 -04:00
Jawwad Ahmad
7cbccfd322 Delete ivars that are already @synthesized. Refs #614. 2012-07-11 10:34:29 -04:00
Jawwad Ahmad
abb46c382c Ensure the stars for all pointers belong to the variable rather than the type. Refs #614 2012-06-04 22:47:30 -04:00
Blake Watters
fcb973056b Cleanup trailing whitespace. refs #743 2012-05-17 18:00:16 -04:00
Blake Watters
457a6126cf Refresh copyright notices for all source files 2012-04-04 09:08:54 -04:00
Blake Watters
887b4a4743 Added support for configuring objectClass using the class name instead of Class object. 2012-04-03 23:39:43 -04:00
Blake Watters
e904394b6b Miscellaneous cleanups 2012-02-17 16:34:03 -05:00
Blake Watters
4d48ef4729 Fixed breakage in OS X support 2012-02-15 17:48:59 -05:00
Blake Watters
3d0f0ab39e Introduced the RKTableController component for iOS.
RKTableController provides a flexible, integrated system for driving iOS table views using
the RestKit object mapping engine. Local domain objects can be mapped into table cells within a
collection or presented for editing as part of a form. There are three flavors of table controllers
available:

* Static Tables: RKTableController can be used to render simple static tables that are composed of RKTableItems
presented in RKTableSections. Table items can quickly be built and added to a table without a backing model
or can have content object mapped into them for presentation.
* Network Tables: RKTableController can also render a table with the results of a network load. The typical use
case here is to have RestKit retrieve a JSON/XML payload from your remote system and then render the content into
a table.
* Core Data Tables: RKFetchedResultsTableController can efficiently drive a table view using objects pulled from a
Core Data managed object context. Typical use-cases here are for the presentation of large collections that are
pulled from a remote system, offering offline access, or speeding up a UI by using Core Data as a fast local cache.

RKTableController supports a number of bells and whistles including integrated searching/filtering and pull to refresh.
2012-02-10 16:30:54 -05:00
Christopher Swasey
886ec75283 Import http://boredzo.org/iso8601parser/ and add it as a defaultDateFormatter for parsing ISO8601 strings. Fixes #438 2012-01-20 15:13:45 -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
586034bae4 Add support for the use of nesting key attributes as the primaryKey in managed mappings.
This bug was causing duplication of objects in the store due to failed lookup of
existing objects. Added fix and test coverage for the use-case.
2011-10-05 10:50:52 -04:00
Blake Watters
91a6e9423e Added convenience methods and docs for mapping NSSet and NSArray attribute collections. fixes #285 2011-09-19 21:03:02 -04:00
Parker
99250475ad added Apache License headers to all files in ObjectMapping directory 2011-09-07 11:31:01 -04:00
Blake Watters
2ccc44954a Configured default locale to en_US_POSIX for default date formatters. closes #273 2011-09-05 17:54:07 -04:00
Blake Watters
54007c78d4 Reworked Brendan Ribera's contributions around time zone handling to eliminate the use of transient
NSDateFormatters, added a preferredDateFormatter for use when serializing dates to strings,
replaced the use of the description method for date encoding to strings with invocation of the
preferredDateFormatter, added new attribute transformation strategy from NSDate -> NSString properties
(also using the preferred date formatter), and provided customization support for date handling globally
and on a per-mapping basis. closes #200, closes #313, closes #309, closes #308
2011-09-05 17:25:43 -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
570b13ca07 Updated Object Mapping documentation, added support for inferring object mappings based off of the type of the object used in postObject:, putObject:, etc. Made KVC validation optional. 2011-07-23 23:47:03 -04:00
Blake Watters
80366afa84 Added Object Mapping block helpers to RKObjectManager and RKObjectMapping. These enable you to perform ad-hoc object mapping very easily. Extended RKObjectRouter to match on superclasses if no specific route is found. This is helpful when using mocked objects with frameworks like Kiwi. fixes #238 2011-07-23 23:04:16 -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
64db97ce60 Helper methods for retrieving attribute and relationship mappings by attribute/relationship keyPath. Useful for customizing serialization mappings that were built using inverseMapping. 2011-06-22 10:43:42 -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
Blake Watters
3bf4b7bc0f Implemented nested mapping for structures similar to the BuildBot JSON structure. fixes #112 2011-06-17 15:36:28 -04:00
Ed McManus
ecf808af1a Added boolean "reversible" property to RKObjectRelationshipMapping. This can be used to break cyclical
relationships in the object mapping graph. Relationships can be optionally included in an inverse mapping
generation for serialization purposes.
2011-06-11 20:25:28 -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