chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1425870 [3/13] - in /chemistry/objectivecmis/trunk: ./ ObjectiveCMIS.xcodeproj/ ObjectiveCMIS.xcodeproj/project.xcworkspace/ ObjectiveCMIS/ ObjectiveCMIS/Bindings/ ObjectiveCMIS/Bindings/AtomPub/ ObjectiveCMIS/Bindings/AtomPub/AtomPubParse...
Date Wed, 26 Dec 2012 10:48:37 GMT
Added: chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS.xcodeproj/project.xcworkspace/contents.xcworkspacedata Wed Dec 26 10:48:33 2012
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:ObjectiveCMIS.xcodeproj">
+   </FileRef>
+</Workspace>

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,38 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISAllowableActions.h"
+#import "CMISAtomPubExtensionDataParserBase.h"
+
+@class CMISAllowableActionsParser;
+
+@protocol CMISAllowableActionsParserDelegate <NSObject>
+@optional
+- (void)allowableActionsParser:(CMISAllowableActionsParser *)parser didFinishParsingAllowableActions:(CMISAllowableActions *)allowableActions;
+
+@end
+
+
+@interface CMISAllowableActionsParser : CMISAtomPubExtensionDataParserBase <NSXMLParserDelegate>
+
+@property (nonatomic, strong) CMISAllowableActions *allowableActions;
+// Designated Initializer
+- (id)initWithData:(NSData*)atomData;
+- (BOOL)parseAndReturnError:(NSError **)error;
+
+// Delegates parsing to child parser, ensure that the Element is 'allowableActions'
++ (id)allowableActionsParserWithParentDelegate:(id<NSXMLParserDelegate, CMISAllowableActionsParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,163 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISAllowableActionsParser.h"
+#import "CMISAtomPubConstants.h"
+
+@interface CMISAllowableActionsParser ()
+
+@property (nonatomic, strong) NSMutableDictionary *internalAllowableActionsDict;
+@property (nonatomic, weak) id<NSXMLParserDelegate, CMISAllowableActionsParserDelegate> parentDelegate;
+@property (nonatomic, strong) NSMutableString *string;
+@property (nonatomic, strong) NSData *atomData;
+
+// Private init Used for child delegate parser
+- (id)initWithParentDelegate:(id<NSXMLParserDelegate, CMISAllowableActionsParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+@end
+
+
+@implementation CMISAllowableActionsParser
+
+@synthesize internalAllowableActionsDict = _internalAllowableActionsDict;
+@synthesize parentDelegate = _parentDelegate;
+@synthesize string = _string;
+@synthesize atomData = _atomData;
+@synthesize allowableActions;
+
+#pragma mark - 
+#pragma mark Init/Create methods
+
+- (id)initWithParentDelegate:(id<NSXMLParserDelegate, CMISAllowableActionsParserDelegate>)parentDelegate parser:(NSXMLParser *)parser 
+{
+    self = [self initWithData:nil];
+    if (self) 
+    {
+        self.parentDelegate = parentDelegate;
+        self.internalAllowableActionsDict = [[NSMutableDictionary alloc] init];
+        
+        self.allowableActions = [[CMISAllowableActions alloc] init];
+        [self pushNewCurrentExtensionData:self.allowableActions];
+        
+        // Setting Child Parser Delegate
+        [parser setDelegate:self];
+    }
+    return self;
+}
+
++ (id)allowableActionsParserWithParentDelegate:(id<NSXMLParserDelegate, CMISAllowableActionsParserDelegate>)parentDelegate parser:(NSXMLParser *)parser
+{
+    return [[[self class] alloc] initWithParentDelegate:parentDelegate parser:parser];
+}
+
+// Designated Initializer
+- (id)initWithData:(NSData*)atomData
+{
+    self = [super init];
+    if (self)
+    {
+        self.atomData = atomData;
+    }
+    
+    return self;
+}
+
+- (BOOL)parseAndReturnError:(NSError **)error;
+{
+    BOOL parseSuccessful = YES;
+    
+    // parse the AtomPub data
+    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:self.atomData];
+    [parser setShouldProcessNamespaces:YES];
+    [parser setDelegate:self];
+    
+    parseSuccessful = [parser parse];
+    
+    if (!parseSuccessful)
+    {
+        if (error)
+        {
+            *error = [parser parserError];
+        }
+    }
+    
+    return parseSuccessful;
+}
+
+#pragma mark - 
+#pragma mark NSXMLParserDelegate Methods
+
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
+  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
+    attributes:(NSDictionary *)attributeDict 
+{
+    if ([namespaceURI isEqualToString:kCMISNamespaceCmis])
+    {
+        
+        if ([elementName isEqualToString:kCMISAtomEntryAllowableActions]) 
+        {
+            [self setInternalAllowableActionsDict:[NSMutableDictionary dictionary]];
+            
+            self.allowableActions = [[CMISAllowableActions alloc] init];
+            [self pushNewCurrentExtensionData:self.allowableActions];
+        }
+        else
+        {
+            self.string = [NSMutableString string];
+        }
+    }
+    else 
+    {
+        self.childParserDelegate = [CMISAtomPubExtensionElementParser extensionElementParserWithElementName:elementName namespaceUri:namespaceURI 
+                                                                                                 attributes:attributeDict parentDelegate:self parser:parser];
+    }
+}
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string 
+{
+    [self.string appendString:string];
+}
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName 
+{
+    if ([namespaceURI isEqualToString:kCMISNamespaceCmis])
+    {
+        if ([elementName isEqualToString:kCMISAtomEntryAllowableActions])
+        {
+            // Set the parsed dictionary of allowable actions
+            [self.allowableActions setAllowableActionsWithDictionary:[self.internalAllowableActionsDict copy]];
+            // Save the extension data
+            [self saveCurrentExtensionsAndPushPreviousExtensionData];
+            
+            if (self.parentDelegate)
+            {
+                if ([self.parentDelegate respondsToSelector:@selector(allowableActionsParser:didFinishParsingAllowableActions:)])
+                {
+                    [self.parentDelegate performSelector:@selector(allowableActionsParser:didFinishParsingAllowableActions:) withObject:self withObject:self.allowableActions];
+                }
+                
+                // Reset Delegate to parent
+                [parser setDelegate:self.parentDelegate];
+                self.parentDelegate = nil;
+            }
+        }
+        else
+        {
+            [self.internalAllowableActionsDict setObject:self.string forKey:elementName];
+        }
+    }
+    
+    self.string = nil;
+}
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAllowableActionsParser.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,45 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISConstants.h"
+#import "CMISAtomPubConstants.h"
+#import "CMISObjectData.h"
+#import "CMISPropertyData.h"
+#import "CMISProperties.h"
+#import "CMISAllowableActionsParser.h"
+#import "CMISAtomPubExtensionElementParser.h"
+#import "CMISAtomPubExtensionDataParserBase.h"
+
+@protocol CMISAtomEntryParserDelegate;
+
+@interface CMISAtomEntryParser : CMISAtomPubExtensionDataParserBase <NSXMLParserDelegate, CMISAllowableActionsParserDelegate>
+
+@property (nonatomic, strong, readonly) CMISObjectData *objectData;
+
+// Designated Initializer
+- (id)initWithData:(NSData *)atomData;
+- (BOOL)parseAndReturnError:(NSError **)error;
+
+// Initializes a child parser for an Atom Entry and takes over parsing control while parsing the Atom Entry
++ (id)atomEntryParserWithAtomEntryAttributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomEntryParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+
+@end
+
+
+@protocol CMISAtomEntryParserDelegate <NSObject>
+@optional
+- (void)cmisAtomEntryParser:(id)entryParser didFinishParsingCMISObjectData:(CMISObjectData *)cmisObjectData;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,362 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISAtomEntryParser.h"
+#import "CMISAtomLink.h"
+#import "CMISRenditionData.h"
+#import "CMISAtomParserUtil.h"
+
+@interface CMISAtomEntryParser ()
+
+@property (nonatomic, strong, readwrite) CMISObjectData *objectData;
+
+@property (nonatomic, strong) NSData *atomData;
+@property (nonatomic, strong) NSString *currentPropertyType;
+@property (nonatomic, strong) CMISPropertyData *currentPropertyData;
+@property (nonatomic, strong) NSMutableArray *propertyValues;
+@property (nonatomic, strong) CMISProperties *currentObjectProperties;
+@property (nonatomic, strong) NSMutableSet *currentLinkRelations;
+@property (nonatomic, strong) CMISRenditionData *currentRendition;
+@property (nonatomic, strong) NSMutableArray *currentRenditions;
+@property (nonatomic, strong) NSMutableString *string;
+
+@property (nonatomic, weak) id<NSXMLParserDelegate, CMISAtomEntryParserDelegate> parentDelegate;
+@property (nonatomic, strong) NSDictionary *entryAttributesDict;
+
+// Designated initializer
+- (id)init;
+// Initializer used if this parser is a delegated child parser
+- (id)initWithAtomEntryAttributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomEntryParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+
+@end
+
+
+@implementation CMISAtomEntryParser
+
+@synthesize objectData = _objectData;
+@synthesize atomData = _atomData;
+@synthesize currentPropertyType = _currentPropertyType;
+@synthesize currentPropertyData = _currentPropertyData;
+@synthesize propertyValues = _propertyValues;
+@synthesize currentObjectProperties = _currentObjectProperties;
+@synthesize currentLinkRelations = _currentLinkRelations;
+@synthesize parentDelegate = _parentDelegate;
+@synthesize entryAttributesDict = _entryAttributesDict;
+@synthesize currentRendition = _currentRendition;
+@synthesize currentRenditions = _currentRenditions;
+@synthesize string = _string;
+
+// Designated Initializer
+- (id)init
+{
+    self = [super init];
+    if (self)
+    {
+        self.currentLinkRelations = [NSMutableSet set];
+    }
+    return self;
+}
+
+- (id)initWithData:(NSData *)atomData
+{
+    self = [self init];
+    if (self)
+    {
+        self.atomData = atomData;
+    }
+    
+    return self;
+}
+
+- (BOOL)parseAndReturnError:(NSError **)error;
+{
+    BOOL parseSuccessful = YES;
+    
+    // create objects to populate during parse
+    self.objectData = [[CMISObjectData alloc] init];
+    
+    // parse the AtomPub data
+    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:self.atomData];
+    [parser setShouldProcessNamespaces:YES];
+    [parser setDelegate:self];
+
+    parseSuccessful = [parser parse];
+    
+    if (!parseSuccessful)
+    {
+        if (error)
+        {
+            *error = [parser parserError];
+        }
+    }
+    
+    return parseSuccessful;
+}
+
+- (id)initWithAtomEntryAttributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomEntryParserDelegate>)parentDelegate parser:(NSXMLParser *)parser
+{
+    self = [self init];
+    if (self)
+    {
+        self.objectData = [[CMISObjectData alloc] init];
+        self.entryAttributesDict = attributes;
+        self.parentDelegate = parentDelegate;
+        
+        // Setting ourself, the entry parser, as the delegate, we reset back to our parent when we're done
+        [parser setDelegate:self];
+    }
+    return self;
+}
+
++ (id)atomEntryParserWithAtomEntryAttributes:(NSDictionary *)attributes
+                              parentDelegate:(id<NSXMLParserDelegate,CMISAtomEntryParserDelegate>)parentDelegate
+                                      parser:(NSXMLParser *)parser
+{
+    return [[self alloc] initWithAtomEntryAttributes:attributes parentDelegate:parentDelegate parser:parser];
+}
+
+#pragma mark -
+#pragma mark NSXMLParser delegate methods
+
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI
+                                            qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
+{
+    if ([namespaceURI isEqualToString:kCMISNamespaceCmis])
+    {
+        if ([elementName isEqualToString:kCMISAtomEntryPropertyId] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyString] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyInteger] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyDateTime] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyBoolean] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyUri] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyHtml] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyDecimal])
+        {
+            self.propertyValues = [NSMutableArray array];
+            // store attribute values in CMISPropertyData object
+            self.currentPropertyType = elementName;
+            self.currentPropertyData = [[CMISPropertyData alloc] init];
+            self.currentPropertyData.identifier = [attributeDict objectForKey:kCMISAtomEntryPropertyDefId];
+            self.currentPropertyData.queryName = [attributeDict objectForKey:kCMISAtomEntryQueryName];
+            self.currentPropertyData.displayName = [attributeDict objectForKey:kCMISAtomEntryDisplayName];
+        }
+        else if ([elementName isEqualToString:kCMISCoreProperties])
+        {
+            // create the CMISProperties object to hold all property data
+            self.currentObjectProperties = [[CMISProperties alloc] init];
+            
+            // Set ObjectProperties as the current extensionData object
+            [self pushNewCurrentExtensionData:self.currentObjectProperties];
+        }
+        else if ([elementName isEqualToString:kCMISCoreRendition])
+        {
+            self.currentRendition = [[CMISRenditionData alloc] init];
+        }
+        else if ([elementName isEqualToString:kCMISAtomEntryAllowableActions]) 
+        {
+            // Delegate parsing to child parser for allowableActions element
+            self.childParserDelegate = [CMISAllowableActionsParser allowableActionsParserWithParentDelegate:self parser:parser];
+        }
+    }
+    else if ([namespaceURI isEqualToString:kCMISNamespaceCmisRestAtom])
+    {
+        if ([elementName isEqualToString:kCMISAtomEntryObject])
+        {
+            // Set object data as the current extensionData object
+            [self pushNewCurrentExtensionData:self.objectData];
+        }
+    }
+    else if ([namespaceURI isEqualToString:kCMISNamespaceAtom])
+    {
+        if ([elementName isEqualToString:kCMISAtomEntryLink])
+        {
+            NSString *linkType = [attributeDict objectForKey:kCMISAtomEntryType];
+            NSString *rel = [attributeDict objectForKey:kCMISAtomEntryRel];
+            NSString *href = [attributeDict objectForKey:kCMISAtomEntryHref]; 
+            
+            CMISAtomLink *link = [[CMISAtomLink alloc] initWithRelation:rel type:linkType href:href];
+            [self.currentLinkRelations addObject:link];
+        }
+        else if ([elementName isEqualToString:kCMISAtomEntryContent])
+        {
+            self.objectData.contentUrl = [NSURL URLWithString:[attributeDict objectForKey:kCMISAtomEntrySrc]];
+        }
+    }
+    else if ([namespaceURI isEqualToString:kCMISNamespaceApp])
+    {
+        // Nothing to do in this namespace
+    }
+    else 
+    {
+        if (self.currentExtensionData != nil)
+        {
+            self.childParserDelegate = [CMISAtomPubExtensionElementParser extensionElementParserWithElementName:elementName namespaceUri:namespaceURI 
+                                                                                                     attributes:attributeDict parentDelegate:self parser:parser];
+        }
+    }
+    
+    self.string = [NSMutableString string];
+}
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
+{
+    [self.string appendString:string];
+}
+
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName 
+{
+   
+    if ([elementName isEqualToString:kCMISAtomEntryValue])
+    {
+        [CMISAtomParserUtil parsePropertyValue:self.string withPropertyType:self.currentPropertyType addToArray:self.propertyValues];
+    }
+    else if (self.currentRendition != nil)
+    {
+        if ([elementName isEqualToString:kCMISCoreStreamId])
+        {
+            self.currentRendition.streamId = self.string;
+        }
+        else if ([elementName isEqualToString:kCMISCoreMimetype])
+        {
+            self.currentRendition.mimeType = self.string;
+        }
+        else if ([elementName isEqualToString:kCMISCoreLength])
+        {
+            self.currentRendition.length = [NSNumber numberWithInteger:[self.string integerValue]];
+        }
+        else if ([elementName isEqualToString:kCMISCoreTitle])
+        {
+            self.currentRendition.title = self.string;
+        }
+        else if ([elementName isEqualToString:kCMISCoreKind])
+        {
+            self.currentRendition.kind = self.string;
+        }
+        else if ([elementName isEqualToString:kCMISCoreHeight])
+        {
+            self.currentRendition.height = [NSNumber numberWithInteger:[self.string integerValue]];
+        }
+        else if ([elementName isEqualToString:kCMISCoreWidth])
+        {
+            self.currentRendition.width = [NSNumber numberWithInteger:[self.string integerValue]];
+        }
+        else if ([elementName isEqualToString:kCMISCoreRenditionDocumentId])
+        {
+            self.currentRendition.renditionDocumentId = self.string;
+        }
+    }
+    
+    if ([namespaceURI isEqualToString:kCMISNamespaceCmis])
+    {
+        if ([elementName isEqualToString:kCMISAtomEntryPropertyId] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyString] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyInteger] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyDateTime] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyBoolean] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyUri] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyHtml] ||
+            [elementName isEqualToString:kCMISAtomEntryPropertyDecimal])
+        {            
+            // add the property to the properties dictionary
+            self.currentPropertyData.values = self.propertyValues;
+            self.propertyValues = nil;
+            [self.currentObjectProperties addProperty:self.currentPropertyData];
+            self.currentPropertyData = nil;
+        }
+        else if ([elementName isEqualToString:kCMISCoreProperties])
+        {
+            // Finished parsing Properties & its ExtensionData
+            [self saveCurrentExtensionsAndPushPreviousExtensionData];
+        }
+        else if ([elementName isEqualToString:kCMISCoreRendition])
+        {
+            if (self.currentRenditions == nil)
+            {
+                self.currentRenditions = [[NSMutableArray alloc] init];
+            }
+            [self.currentRenditions addObject:self.currentRendition];
+            self.currentRendition = nil;
+        }
+    }
+    else if ([namespaceURI isEqualToString:kCMISNamespaceAtom])
+    {
+        if ( [elementName isEqualToString:kCMISAtomEntry])
+        {
+            // set the properties on the objectData object
+            self.objectData.properties = self.currentObjectProperties;
+
+            // set the link relations on the objectData object
+            self.objectData.linkRelations = [[CMISLinkRelations alloc] initWithLinkRelationSet:[self.currentLinkRelations copy]];
+
+            // set the renditions on the objectData object
+            self.objectData.renditions = self.currentRenditions;
+
+            // set the objectData identifier
+            CMISPropertyData *objectId = [self.currentObjectProperties.propertiesDictionary objectForKey:kCMISPropertyObjectId];
+            self.objectData.identifier = [objectId firstValue];
+
+            // set the objectData baseType
+            CMISPropertyData *baseTypeProperty = [self.currentObjectProperties.propertiesDictionary objectForKey:kCMISPropertyBaseTypeId];
+            NSString *baseType = [baseTypeProperty firstValue];
+            if ([baseType isEqualToString:kCMISPropertyObjectTypeIdValueDocument])
+            {
+                self.objectData.baseType = CMISBaseTypeDocument;
+            }
+            else if ([baseType isEqualToString:kCMISPropertyObjectTypeIdValueFolder])
+            {
+                self.objectData.baseType = CMISBaseTypeFolder;
+            }
+
+            // set the extensionData
+            [self saveCurrentExtensionsAndPushPreviousExtensionData];
+
+            self.currentObjectProperties = nil;
+
+            if (self.parentDelegate)
+            {
+                if ([self.parentDelegate respondsToSelector:@selector(cmisAtomEntryParser:didFinishParsingCMISObjectData:)])
+                {
+                    // Message the parent delegate the parsed ObjectData
+                    [self.parentDelegate performSelector:@selector(cmisAtomEntryParser:didFinishParsingCMISObjectData:)
+                                              withObject:self withObject:self.objectData];
+                }
+
+                // Reseting our parent as the delegate since we're done
+                parser.delegate = self.parentDelegate;
+                self.parentDelegate = nil;
+            }
+        }
+    }
+    else if ([namespaceURI isEqualToString:kCMISNamespaceApp])
+    {
+        // Nothing to do in this namespace
+    }
+    else 
+    {
+        // TODO other namespaces?
+    }
+
+    self.string = nil;
+}
+
+#pragma mark -
+#pragma mark CMISAllowableActionsParserDelegate Methods
+
+- (void)allowableActionsParser:(CMISAllowableActionsParser *)parser didFinishParsingAllowableActions:(CMISAllowableActions *)allowableActions
+{
+    self.objectData.allowableActions = allowableActions;
+}
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomEntryParser.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,42 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISAtomPubConstants.h"
+#import "CMISObjectData.h"
+#import "CMISPropertyData.h"
+#import "CMISProperties.h"
+#import "CMISAtomEntryParser.h"
+
+@interface CMISAtomFeedParser : NSObject <NSXMLParserDelegate, CMISAtomEntryParserDelegate>
+
+/**
+ * The entries contained in the feed (array of CMISObjectData objects).
+ */
+@property (nonatomic, strong, readonly) NSArray *entries;
+
+/**
+ * The links for the feed.
+ */
+@property (nonatomic, strong, readonly) CMISLinkRelations *linkRelations;
+
+/**
+ * Number of items will be returned when executing a query.
+ */
+@property (readonly) NSInteger numItems;
+
+- (id)initWithData:(NSData*)feedData;
+- (BOOL)parseAndReturnError:(NSError **)error;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,134 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISAtomFeedParser.h"
+#import "CMISAtomLink.h"
+
+@interface CMISAtomFeedParser ()
+@property (nonatomic, strong, readwrite) NSData *feedData;
+@property (nonatomic, strong, readwrite) NSMutableArray *internalEntries;
+@property (readwrite) NSInteger numItems;
+@property (nonatomic, strong, readwrite) NSMutableSet *feedLinkRelations;
+@property (nonatomic, strong, readwrite) id childParserDelegate;
+@property (nonatomic, strong) NSMutableString *string;
+@end
+
+@implementation CMISAtomFeedParser
+
+@synthesize feedData = _feedData;
+@synthesize internalEntries = _internalEntries;
+@synthesize numItems = _numItems;
+@synthesize feedLinkRelations = _feedLinkRelations;
+@synthesize childParserDelegate = _childParserDelegate;
+@synthesize string = _string;
+
+- (id)initWithData:(NSData*)feedData
+{
+    self = [super init];
+    if (self)
+    {
+        self.feedData = feedData;
+        self.feedLinkRelations = [NSMutableSet set];
+    }
+    
+    return self;
+}
+
+- (NSArray *)entries
+{
+    if (self.internalEntries != nil)
+    {
+        return [NSArray arrayWithArray:self.internalEntries];
+    }
+    else 
+    {
+        return nil;
+    }
+}
+
+- (CMISLinkRelations *)linkRelations
+{
+    return [[CMISLinkRelations alloc] initWithLinkRelationSet:self.feedLinkRelations];
+}
+
+- (BOOL)parseAndReturnError:(NSError **)error;
+{
+    BOOL parseSuccessful = YES;
+    
+    // create objects to populate during parse
+    self.internalEntries = [NSMutableArray array];
+    
+    // parse the AtomPub data
+    NSXMLParser *parser = [[NSXMLParser alloc] initWithData:self.feedData];
+    [parser setShouldProcessNamespaces:YES];
+    [parser setDelegate:self];
+    parseSuccessful = [parser parse];
+    
+    if (!parseSuccessful)
+    {
+        if (error)
+        {
+            *error = [parser parserError];
+        }
+    }
+
+    return parseSuccessful;
+}
+
+#pragma mark -
+#pragma mark NSXMLParser delegate methods
+
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict 
+{
+    if ([elementName isEqualToString:kCMISAtomEntry])
+    {
+        // Delegate parsing of AtomEntry element to the entry child parser
+        self.childParserDelegate = [CMISAtomEntryParser atomEntryParserWithAtomEntryAttributes:attributeDict parentDelegate:self parser:parser];
+    }
+    else if ([elementName isEqualToString:kCMISAtomEntryLink])
+    {
+        CMISAtomLink *link = [[CMISAtomLink alloc] init];
+        [link setValuesForKeysWithDictionary:attributeDict];
+        [self.feedLinkRelations addObject:link];
+    }
+    
+    self.string = [NSMutableString string];
+}
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
+{
+    [self.string appendString:string];
+}
+
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName 
+{
+    if ([elementName isEqualToString:kCMISAtomFeedNumItems])
+    {
+        self.numItems = [self.string integerValue];
+    }
+
+    self.string = nil;
+}
+
+
+#pragma mark -
+#pragma mark CMISAtomEntryParserDelegate Methods
+
+- (void)cmisAtomEntryParser:(CMISAtomEntryParser *)entryParser didFinishParsingCMISObjectData:(CMISObjectData *)cmisObjectData
+{
+    [self.internalEntries addObject:cmisObjectData];
+}
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomFeedParser.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,29 @@
+/*
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+//
+// CMISAtomParserUtil
+//
+#import <Foundation/Foundation.h>
+#import "CMISEnums.h"
+
+
+
+@interface CMISAtomParserUtil : NSObject
+
++ (CMISPropertyType)atomPubTypeToInternalType:(NSString *)atomPubType;
+
++ (void)parsePropertyValue:(NSString *)stringValue withPropertyType:(NSString *)propertyType addToArray:(NSMutableArray*)array;
+
+@end
\ No newline at end of file

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,101 @@
+/*
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+//
+// CMISAtomParserUtil
+//
+#import "CMISAtomParserUtil.h"
+#import "CMISAtomPubConstants.h"
+#import "CMISDateUtil.h"
+
+
+@implementation CMISAtomParserUtil
+
++ (CMISPropertyType)atomPubTypeToInternalType:(NSString *)atomPubType
+{
+    if([atomPubType isEqualToString:kCMISAtomEntryPropertyId])
+    {
+        return CMISPropertyTypeId;
+    }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyString])
+       {
+           return CMISPropertyTypeString;
+       }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyInteger])
+    {
+        return CMISPropertyTypeInteger;
+    }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyBoolean])
+    {
+        return CMISPropertyTypeBoolean;
+    }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyDateTime])
+    {
+        return CMISPropertyTypeDateTime;
+    }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyDecimal])
+    {
+        return CMISPropertyTypeDecimal;
+    }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyHtml])
+    {
+        return CMISPropertyTypeHtml;
+    }
+    else if ([atomPubType isEqualToString:kCMISAtomEntryPropertyUri])
+    {
+        return CMISPropertyTypeUri;
+    }
+    else
+    {
+        log(@"Unknow property type %@. Go tell a developer to fix this.", atomPubType);
+        return CMISPropertyTypeString;
+    }
+}
+
++ (void)parsePropertyValue:(NSString *)stringValue withPropertyType:(NSString *)propertyType addToArray:(NSMutableArray*)array
+{
+    if ([propertyType isEqualToString:kCMISAtomEntryPropertyString] ||
+        [propertyType isEqualToString:kCMISAtomEntryPropertyId] ||
+        [propertyType isEqualToString:kCMISAtomEntryPropertyHtml])
+    {
+        [array addObject:stringValue];
+    }
+    else if ([propertyType isEqualToString:kCMISAtomEntryPropertyInteger])
+    {
+        [array addObject:[NSNumber numberWithInt:[stringValue intValue]]];
+    }
+    else if ([propertyType isEqualToString:kCMISAtomEntryPropertyBoolean])
+    {
+        [array addObject:[NSNumber numberWithBool:[stringValue isEqualToString:kCMISAtomEntryValueTrue]]];
+    }
+    else if ([propertyType isEqualToString:kCMISAtomEntryPropertyDateTime])
+    {
+        [array addObject:[CMISDateUtil dateFromString:stringValue]];
+    }
+    else if ([propertyType isEqualToString:kCMISAtomEntryPropertyDecimal])
+    {
+        [array addObject:[NSDecimalNumber decimalNumberWithString:stringValue]];
+    }
+    else if ([propertyType isEqualToString:kCMISAtomEntryPropertyUri])
+    {
+        [array addObject:[NSURL URLWithString:stringValue]];
+    }
+    else
+    {
+        log(@"Unknow property type %@. Go tell a developer to fix this.", propertyType);
+    }
+}
+
+
+@end
\ No newline at end of file

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomParserUtil.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,183 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+// Feed
+extern NSString * const kCMISAtomFeedNumItems;
+
+// Entry
+extern NSString * const kCMISAtomEntry;
+extern NSString * const kCMISAtomEntryLink;
+extern NSString * const kCMISAtomEntryLinkTypeAtomFeed;
+extern NSString * const kCMISAtomEntryRel;
+extern NSString * const kCMISAtomEntryHref;
+extern NSString * const kCMISAtomEntryType;
+extern NSString * const kCMISAtomEntryObject;
+extern NSString * const kCMISAtomEntryProperties;
+extern NSString * const kCMISAtomEntryPropertyId;
+extern NSString * const kCMISAtomEntryPropertyString;
+extern NSString * const kCMISAtomEntryPropertyInteger;
+extern NSString * const kCMISAtomEntryPropertyDecimal;
+extern NSString * const kCMISAtomEntryPropertyDateTime;
+extern NSString * const kCMISAtomEntryPropertyBoolean;
+extern NSString * const kCMISAtomEntryPropertyUri;
+extern NSString * const kCMISAtomEntryPropertyHtml;
+extern NSString * const kCMISAtomEntryPropertyDefId;
+extern NSString * const kCMISAtomEntryDisplayName;
+extern NSString * const kCMISAtomEntryQueryName;
+extern NSString * const kCMISAtomEntryValue;
+extern NSString * const kCMISAtomEntryValueTrue;
+extern NSString * const kCMISAtomEntryContent;
+extern NSString * const kCMISAtomEntrySrc;
+extern NSString * const kCMISAtomEntryAllowableActions;
+
+// Collections
+extern NSString * const kCMISAtomCollectionQuery;
+
+// Links
+extern NSString * const kCMISLinkRelationDown;
+extern NSString * const kCMISLinkRelationUp;
+extern NSString * const kCMISLinkRelationSelf;
+extern NSString * const kCMISLinkRelationFolderTree;
+extern NSString * const kCMISLinkVersionHistory;
+extern NSString * const kCMISLinkEditMedia;
+extern NSString * const kCMISLinkRelationNext;
+
+// URL parameters
+extern NSString * const kCMISParameterChangeToken;
+extern NSString * const kCMISParameterOverwriteFlag;
+extern NSString * const kCMISParameterIncludeAllowableActions;
+extern NSString * const kCMISParameterFilter;
+extern NSString * const kCMISParameterMaxItems;
+extern NSString * const kCMISParameterObjectId;
+extern NSString * const kCMISParameterOrderBy;
+extern NSString * const kCMISParameterIncludePathSegment;
+extern NSString * const kCMISParameterIncludeRelationships;
+extern NSString * const kCMISParameterRenditionFilter;
+extern NSString * const kCMISParameterSkipCount;
+extern NSString * const kCMISParameterStreamId;
+extern NSString * const kCMISParameterAllVersions;
+extern NSString * const kCMISParameterContinueOnFailure;
+extern NSString * const kCMISParameterUnfileObjects;
+extern NSString * const kCMISParameterRelativePathSegment;
+
+
+// Namespaces
+extern NSString * const kCMISNamespaceCmis;
+extern NSString * const kCMISNamespaceCmisRestAtom;
+extern NSString * const kCMISNamespaceAtom;
+extern NSString * const kCMISNamespaceApp;
+
+// Media Types
+extern NSString * const kCMISMediaTypeService;
+extern NSString * const kCMISMediaTypeFeed;
+extern NSString * const kCMISMediaTypeEntry;
+extern NSString * const kCMISMediaTypeChildren;
+extern NSString * const kCMISMediaTypeDescendants;
+extern NSString * const kCMISMediaTypeQuery;
+extern NSString * const kCMISMediaTypeAllowableAction;
+extern NSString * const kCMISMediaTypeAcl;
+extern NSString * const kCMISMediaTypeCmisAtom;
+extern NSString * const kCMISMediaTypeOctetStream;
+
+// App Element Names
+extern NSString * const kCMISAppWorkspace;
+extern NSString * const kCMISAppCollection;
+extern NSString * const kCMISAppAccept;
+
+// Atom Element Names
+extern NSString * const kCMISAtomTitle;
+extern NSString * const kCMISAtomLink;
+
+// CMIS RestAtom Element Names
+extern NSString * const kCMISRestAtomRepositoryInfo;
+extern NSString * const kCMISRestAtomCollectionType;
+extern NSString * const kCMISRestAtomUritemplate;
+extern NSString * const kCMISRestAtomMediaType;
+extern NSString * const kCMISRestAtomType;
+extern NSString * const kCMISRestAtomTemplate;
+
+// CMIS Core Element Names
+extern NSString * const kCMISCoreRepositoryId;
+extern NSString * const kCMISCoreRepositoryName;
+extern NSString * const kCMISCoreRepositoryDescription;
+extern NSString * const kCMISCoreVendorName;
+extern NSString * const kCMISCoreProductName;
+extern NSString * const kCMISCoreProductVersion;
+extern NSString * const kCMISCoreRootFolderId;
+extern NSString * const kCMISCoreCapabilities;
+extern NSString * const _kCMISCoreCapabilityPrefix;
+extern NSString * const kCMISCoreAclCapability;
+extern NSString * const kCMISCorePermissions;
+extern NSString * const kCMISCorePermission;
+extern NSString * const kCMISCoreMapping;
+extern NSString * const kCMISCoreKey;
+extern NSString * const kCMISCoreSupportedPermissions;
+extern NSString * const kCMISCorePropagation;
+extern NSString * const kCMISCoreCmisVersionSupported;
+extern NSString * const kCMISCoreChangesIncomplete;
+extern NSString * const kCMISCoreChangesOnType;
+extern NSString * const kCMISCorePrincipalAnonymous;
+extern NSString * const kCMISCorePrincipalAnyone;
+extern NSString * const kCMISCoreId;
+extern NSString * const kCMISCoreLocalName;
+extern NSString * const kCMISCoreLocalNamespace;
+extern NSString * const kCMISCoreDisplayName;
+extern NSString * const kCMISCoreQueryName;
+extern NSString * const kCMISCoreDescription;
+extern NSString * const kCMISCoreBaseId;
+extern NSString * const kCMISCoreCreatable;
+extern NSString * const kCMISCoreFileable;
+extern NSString * const kCMISCoreQueryable;
+extern NSString * const kCMISCoreFullTextIndexed;
+extern NSString * const kCMISCoreIncludedInSupertypeQuery;
+extern NSString * const kCMISCoreControllablePolicy;
+extern NSString * const kCMISCoreControllableACL;
+extern NSString * const kCMISCoreCardinality;
+extern NSString * const kCMISCoreUpdatability;
+extern NSString * const kCMISCoreInherited;
+extern NSString * const kCMISCoreRequired;
+extern NSString * const kCMISCoreOrderable;
+extern NSString * const kCMISCoreOpenChoice;
+
+extern NSString * const kCMISCorePropertyStringDefinition;
+extern NSString * const kCMISCorePropertyIdDefinition;
+extern NSString * const kCMISCorePropertyBooleanDefinition;
+extern NSString * const kCMISCorePropertyDateTimeDefinition;
+extern NSString * const kCMISCorePropertyIntegerDefinition;
+extern NSString * const kCMISCorePropertyDecimalDefinition;
+extern NSString * const kCMISCoreProperties;
+
+extern NSString * const kCMISCoreRendition;
+extern NSString * const kCMISCoreStreamId;
+extern NSString * const kCMISCoreMimetype;
+extern NSString * const kCMISCoreLength;
+extern NSString * const kCMISCoreKind;
+extern NSString * const kCMISCoreHeight;
+extern NSString * const kCMISCoreWidth;
+extern NSString * const kCMISCoreTitle;
+extern NSString * const kCMISCoreRenditionDocumentId;
+
+// URI Templates
+extern NSString * const kCMISUriTemplateObjectById;
+extern NSString * const kCMISUriTemplateObjectByPath;
+extern NSString * const kCMISUriTemplateTypeById;
+extern NSString * const kCMISUriTemplateQuery;
+
+// Common Attributes
+// TODO Consolidate the common attributes or define individually for each element?
+extern NSString * const kCMISAtomLinkAttrHref;
+extern NSString * const kCMISAtomLinkAttrType;
+extern NSString * const kCMISAtomLinkAttrRel;

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,181 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISAtomPubConstants.h"
+
+// Feed
+NSString * const kCMISAtomFeedNumItems = @"numItems";
+
+// Entry
+NSString * const kCMISAtomEntry = @"entry";
+NSString * const kCMISAtomEntryLink = @"link";
+NSString * const kCMISAtomEntryLinkTypeAtomFeed = @"application/atom+xml;type=feed";
+NSString * const kCMISAtomEntryRel = @"rel";
+NSString * const kCMISAtomEntryHref = @"href";
+NSString * const kCMISAtomEntryType = @"type";
+NSString * const kCMISAtomEntryObject = @"object";
+NSString * const kCMISAtomEntryProperties = @"properties";
+NSString * const kCMISAtomEntryPropertyId = @"propertyId";
+NSString * const kCMISAtomEntryPropertyString = @"propertyString";
+NSString * const kCMISAtomEntryPropertyInteger = @"propertyInteger";
+NSString * const kCMISAtomEntryPropertyDecimal = @"propertyDecimal";
+NSString * const kCMISAtomEntryPropertyDateTime = @"propertyDateTime";
+NSString * const kCMISAtomEntryPropertyBoolean = @"propertyBoolean";
+NSString * const kCMISAtomEntryPropertyUri = @"propertyUri";
+NSString * const kCMISAtomEntryPropertyHtml = @"propertyHtml";
+NSString * const kCMISAtomEntryPropertyDefId = @"propertyDefinitionId";
+NSString * const kCMISAtomEntryDisplayName = @"displayName";
+NSString * const kCMISAtomEntryQueryName = @"queryName";
+NSString * const kCMISAtomEntryValue = @"value";
+NSString * const kCMISAtomEntryValueTrue = @"true";
+NSString * const kCMISAtomEntryContent = @"content";
+NSString * const kCMISAtomEntrySrc = @"src";
+NSString * const kCMISAtomEntryAllowableActions = @"allowableActions";
+
+// Collections
+NSString * const kCMISAtomCollectionQuery = @"query";
+
+// Links
+NSString * const kCMISLinkRelationDown = @"down";
+NSString * const kCMISLinkRelationUp = @"up";
+NSString * const kCMISLinkRelationSelf = @"self";
+NSString * const kCMISLinkRelationFolderTree = @"http://docs.oasis-open.org/ns/cmis/link/200908/foldertree";
+NSString * const kCMISLinkVersionHistory = @"version-history";
+NSString * const kCMISLinkEditMedia = @"edit-media";
+NSString * const kCMISLinkRelationNext = @"next";
+
+// Parameters
+NSString * const kCMISParameterChangeToken = @"changeToken";
+NSString * const kCMISParameterOverwriteFlag = @"overwriteFlag";
+NSString * const kCMISParameterIncludeAllowableActions = @"includeAllowableActions";
+NSString * const kCMISParameterFilter = @"filter";
+NSString * const kCMISParameterMaxItems = @"maxItems";
+NSString * const kCMISParameterObjectId = @"objectId";
+NSString * const kCMISParameterOrderBy = @"orderBy";
+NSString * const kCMISParameterIncludePathSegment = @"includePathSegment";
+NSString * const kCMISParameterIncludeRelationships = @"includeRelationships";
+NSString * const kCMISParameterRenditionFilter = @"renditionFilter";
+NSString * const kCMISParameterSkipCount = @"skipCount";
+NSString * const kCMISParameterStreamId = @"streamId";
+NSString * const kCMISParameterAllVersions = @"allVersions";
+NSString * const kCMISParameterContinueOnFailure= @"continueOnFailure";
+NSString * const kCMISParameterUnfileObjects = @"unfileObjects";
+NSString * const kCMISParameterRelativePathSegment = @"includeRelativePathSegment";
+
+// Namespaces
+NSString * const kCMISNamespaceCmis = @"http://docs.oasis-open.org/ns/cmis/core/200908/";
+NSString * const kCMISNamespaceCmisRestAtom = @"http://docs.oasis-open.org/ns/cmis/restatom/200908/";
+NSString * const kCMISNamespaceAtom = @"http://www.w3.org/2005/Atom";
+NSString * const kCMISNamespaceApp = @"http://www.w3.org/2007/app";
+
+// Media Types
+NSString * const kCMISMediaTypeService = @"application/atomsvc+xml";
+NSString * const kCMISMediaTypeFeed = @"application/atom+xml;type=feed";
+NSString * const kCMISMediaTypeEntry = @"application/atom+xml;type=entry";
+NSString * const kCMISMediaTypeChildren = @"application/atom+xml;type=feed";
+NSString * const kCMISMediaTypeDescendants = @"application/cmistree+xml";
+NSString * const kCMISMediaTypeQuery = @"application/cmisquery+xml";
+NSString * const kCMISMediaTypeAllowableAction  = @"application/cmisallowableactions+xml";
+NSString * const kCMISMediaTypeAcl = @"application/cmisacl+xml";
+NSString * const kCMISMediaTypeCmisAtom = @"application/cmisatom+xml";
+NSString * const kCMISMediaTypeOctetStream = @"application/octet-stream";
+
+// App Element Names
+NSString * const kCMISAppWorkspace = @"workspace";
+NSString * const kCMISAppCollection = @"collection";
+NSString * const kCMISAppAccept = @"accept";
+
+// Atom Element Names
+NSString * const kCMISAtomTitle = @"title";
+NSString * const kCMISAtomLink = @"link";
+
+// CMIS-RestAtom Element Names
+NSString * const kCMISRestAtomRepositoryInfo = @"repositoryInfo";
+NSString * const kCMISRestAtomCollectionType = @"collectionType";
+NSString * const kCMISRestAtomUritemplate = @"uritemplate";
+NSString * const kCMISRestAtomMediaType = @"mediaType";
+NSString * const kCMISRestAtomType = @"type";
+NSString * const kCMISRestAtomTemplate = @"template";
+
+// CMIS-Core Element Names
+NSString * const kCMISCoreRepositoryId = @"repositoryId";
+NSString * const kCMISCoreRepositoryName = @"repositoryName";
+NSString * const kCMISCoreRepositoryDescription = @"repositoryDescription";
+NSString * const kCMISCoreVendorName = @"vendorName";
+NSString * const kCMISCoreProductName = @"productName";
+NSString * const kCMISCoreProductVersion = @"productVersion";
+NSString * const kCMISCoreRootFolderId = @"rootFolderId";
+NSString * const kCMISCoreCapabilities = @"capabilities";
+NSString * const _kCMISCoreCapabilityPrefix = @"capability";
+NSString * const kCMISCoreAclCapability = @"aclCapability";
+NSString * const kCMISCorePermissions = @"permissions";
+NSString * const kCMISCorePermission = @"permission";
+NSString * const kCMISCoreMapping = @"mapping";
+NSString * const kCMISCoreKey = @"key";
+NSString * const kCMISCoreSupportedPermissions = @"supportedPermissions";
+NSString * const kCMISCorePropagation = @"propagation";
+NSString * const kCMISCoreCmisVersionSupported = @"cmisVersionSupported";
+NSString * const kCMISCoreChangesIncomplete = @"changesIncomplete";
+NSString * const kCMISCoreChangesOnType = @"changesOnType";
+NSString * const kCMISCorePrincipalAnonymous = @"principalAnonymous";
+NSString * const kCMISCorePrincipalAnyone = @"principalAnyone";
+NSString * const kCMISCoreId = @"id";
+NSString * const kCMISCoreLocalName = @"localName";
+NSString * const kCMISCoreLocalNamespace = @"localNamespace";
+NSString * const kCMISCoreDisplayName = @"displayName";
+NSString * const kCMISCoreQueryName = @"queryName";
+NSString * const kCMISCoreDescription = @"description";
+NSString * const kCMISCoreBaseId = @"baseId";
+NSString * const kCMISCoreCreatable = @"createable";
+NSString * const kCMISCoreFileable = @"fileable";
+NSString * const kCMISCoreQueryable = @"queryable";
+NSString * const kCMISCoreFullTextIndexed = @"fulltextIndexed";
+NSString * const kCMISCoreIncludedInSupertypeQuery = @"includedInSupertypeQuery";
+NSString * const kCMISCoreControllablePolicy = @"controllablePolicy";
+NSString * const kCMISCoreControllableACL = @"controllableACL";
+NSString * const kCMISCoreCardinality = @"cardinality";
+NSString * const kCMISCoreUpdatability = @"updatability";
+NSString * const kCMISCoreInherited = @"inherited";
+NSString * const kCMISCoreRequired = @"required";
+NSString * const kCMISCoreOrderable = @"queryable";
+NSString * const kCMISCoreOpenChoice = @"openChoice";
+
+NSString * const kCMISCorePropertyStringDefinition = @"propertyStringDefinition";
+NSString * const kCMISCorePropertyIdDefinition = @"propertyIdDefinition";
+NSString * const kCMISCorePropertyBooleanDefinition = @"propertyBooleanDefinition";
+NSString * const kCMISCorePropertyDateTimeDefinition = @"propertyDateTimeDefinition";
+NSString * const kCMISCorePropertyIntegerDefinition = @"propertyIntegerDefinition";
+NSString * const kCMISCorePropertyDecimalDefinition = @"propertyDecimalDefinition";
+NSString * const kCMISCoreProperties = @"properties";
+
+NSString * const kCMISCoreRendition = @"rendition";
+NSString * const kCMISCoreStreamId = @"streamId";
+NSString * const kCMISCoreMimetype = @"mimetype";
+NSString * const kCMISCoreLength = @"length";
+NSString * const kCMISCoreKind = @"kind";
+NSString * const kCMISCoreHeight = @"height";
+NSString * const kCMISCoreWidth = @"width";
+NSString * const kCMISCoreTitle = @"title";
+NSString * const kCMISCoreRenditionDocumentId = @"renditionDocumentId";
+
+// URI Templates
+NSString * const kCMISUriTemplateObjectById = @"objectbyid";
+NSString * const kCMISUriTemplateObjectByPath = @"objectbypath";
+NSString * const kCMISUriTemplateTypeById = @"typebyid";
+NSString * const kCMISUriTemplateQuery = @"query";
+
+// Common Attributes
+NSString * const kCMISAtomLinkAttrHref = @"href";
+NSString * const kCMISAtomLinkAttrType = @"type";
+NSString * const kCMISAtomLinkAttrRel = @"rel";

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubConstants.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,33 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISAtomPubExtensionElementParser.h"
+#import "CMISExtensionData.h"
+
+@interface CMISAtomPubExtensionDataParserBase : NSObject <CMISAtomPubExtensionElementParserDelegate>
+
+@property (nonatomic, strong) id<NSXMLParserDelegate> childParserDelegate;
+@property (nonatomic, strong) NSMutableArray *currentExtensions;
+@property (nonatomic, strong) CMISExtensionData *currentExtensionData;
+@property (nonatomic, strong) NSMutableArray *previousExtensionDataArray;
+
+- (id)init;
+
+// Saves the current extensionData and extensions state and sets the messaged object as the new current extensionData object
+- (void)pushNewCurrentExtensionData:(CMISExtensionData *)extensionDataObject;
+//  Saves the current extensions on the extensionData object and makes the previous extensionData and extensions the current objects
+- (void)saveCurrentExtensionsAndPushPreviousExtensionData;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,94 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISAtomPubExtensionDataParserBase.h"
+
+@implementation CMISAtomPubExtensionDataParserBase
+
+@synthesize childParserDelegate = _childParserDelegate;
+@synthesize currentExtensions = _currentExtensions;
+@synthesize currentExtensionData = _currentExtensionData;
+@synthesize previousExtensionDataArray = _previousExtensionDataArray;
+
+#pragma mark -
+#pragma mark Initializers
+
+// Designated Initializer
+- (id)init
+{
+    self = [super init];
+    if (self)
+    {
+        self.previousExtensionDataArray = [NSMutableArray array];
+    }
+    return self;
+}
+
+#pragma mark - 
+#pragma mark Instance Methods
+
+- (void)pushNewCurrentExtensionData:(CMISExtensionData *)extensionDataObject
+{
+    // Save the current state of the extensionData objects used for parsing
+    if (self.currentExtensionData)
+    {
+        if (self.currentExtensions)
+        {
+            self.currentExtensionData.extensions = [self.currentExtensions copy];
+        }
+        
+        [self.previousExtensionDataArray addObject:self.currentExtensionData];
+    }
+    
+    // Set the new extensionData object provided to be the current
+    self.currentExtensionData = extensionDataObject;
+    // extensions are nil'ed out since we have a new extensionData object
+    self.currentExtensions = nil;
+}
+
+- (void)saveCurrentExtensionsAndPushPreviousExtensionData
+{
+    // set the current extensions 
+    self.currentExtensionData.extensions = [self.currentExtensions copy];
+    self.currentExtensionData = nil;
+    
+    // set the previous extensionData object, note - we don't mind that the return values are nil
+    self.currentExtensionData = self.previousExtensionDataArray.lastObject;
+    self.currentExtensions = [self.currentExtensionData.extensions mutableCopy];
+    
+    // if previous actually existed, remove last object
+    if (self.currentExtensionData)
+    {
+        [self.previousExtensionDataArray removeLastObject];
+    }
+}
+
+#pragma mark -
+#pragma mark CMISAtomPubExtensionElementParserDelegate Method
+
+- (void)extensionElementParser:(CMISAtomPubExtensionElementParser *)parser didFinishParsingExtensionElement:(CMISExtensionElement *)extensionElement
+{
+    // TODO Should abstract the ExtensionData parsing as this pattern is repeated everywhere ExtensionData is getting parsed.
+    
+    if (self.currentExtensions == nil)
+    {
+        self.currentExtensions = [[NSMutableArray alloc] init];
+    }
+    
+    [self.currentExtensions addObject:extensionElement];
+    
+//    self.childParserDelegate = nil;
+}
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionDataParserBase.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,30 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISExtensionElement.h"
+
+@class CMISAtomPubExtensionElementParser;
+
+@protocol CMISAtomPubExtensionElementParserDelegate <NSObject>
+@required
+- (void)extensionElementParser:(CMISAtomPubExtensionElementParser *)parser didFinishParsingExtensionElement:(CMISExtensionElement *)extensionElement;
+@end
+                                                                                                
+
+@interface CMISAtomPubExtensionElementParser : NSObject <NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate>
+
++ (id)extensionElementParserWithElementName:(NSString *)elementName namespaceUri:(NSString *)namespaceUri attributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,125 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISAtomPubExtensionElementParser.h"
+
+
+@interface CMISAtomPubExtensionElementParser ()
+
+// Properties used for Parsing
+@property (nonatomic, strong) id<NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate> childDelegate;
+@property (nonatomic, weak) id<NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate> parentDelegate;
+
+// ExtensionElement properties
+@property (nonatomic, strong) NSString *extensionName;
+@property (nonatomic, strong) NSString *extensionNamespaceUri;
+@property (nonatomic, strong) NSMutableString *extensionValue;
+@property (nonatomic, strong) NSDictionary *extensionAttributes;
+@property (nonatomic, strong) NSMutableArray *extensionChildren;
+
+- (id)initWithElementName:(NSString *)elementName namespaceUri:(NSString *)namespaceUri attributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+@end
+
+@implementation CMISAtomPubExtensionElementParser
+
+@synthesize childDelegate = _childDelegate;
+@synthesize parentDelegate = _parentDelegate;
+@synthesize extensionName = _extensionName;
+@synthesize extensionNamespaceUri = _extensionNamespaceUri;
+@synthesize extensionValue = _extensionValue;
+@synthesize extensionAttributes = _extensionAttributes;
+@synthesize extensionChildren = _extensionChildren;
+
+#pragma mark -
+#pragma mark Initializers
+
+- (id)initWithElementName:(NSString *)elementName namespaceUri:(NSString *)namespaceUri attributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate>)parentDelegate parser:(NSXMLParser *)parser
+{
+    self = [super init];
+    if (self)
+    {
+        self.extensionName = elementName;
+        self.extensionNamespaceUri = namespaceUri;
+        self.extensionAttributes = attributes;
+        self.parentDelegate = parentDelegate;
+        
+        [parser setDelegate:self];
+    }
+    return self;
+}
+
++ (id)extensionElementParserWithElementName:(NSString *)elementName namespaceUri:(NSString *)namespaceUri attributes:(NSDictionary *)attributes parentDelegate:(id<NSXMLParserDelegate, CMISAtomPubExtensionElementParserDelegate>)parentDelegate parser:(NSXMLParser *)parser
+{
+    return  [[self alloc] initWithElementName:elementName namespaceUri:namespaceUri attributes:attributes parentDelegate:parentDelegate parser:parser];
+}
+
+#pragma mark -
+#pragma mark NSXMLParserDelegate Methods
+
+- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict
+{
+    self.childDelegate = [CMISAtomPubExtensionElementParser extensionElementParserWithElementName:elementName namespaceUri:namespaceURI 
+                                                                                       attributes:attributeDict parentDelegate:self parser:parser];
+}
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
+{
+    if (nil == self.extensionValue)
+    {
+        self.extensionValue = [[NSMutableString alloc] init];
+    }
+    [self.extensionValue appendString:string];
+}
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
+{
+    if ([elementName isEqualToString:self.extensionName] && [namespaceURI isEqualToString:self.extensionNamespaceUri])
+    {
+        CMISExtensionElement *extElement = nil;
+        if ([self.extensionChildren count] > 0)
+        {
+            extElement = [[CMISExtensionElement alloc] initNodeWithName:self.extensionName 
+                                                           namespaceUri:self.extensionNamespaceUri 
+                                                             attributes:self.extensionAttributes 
+                                                               children:self.extensionChildren];
+        }
+        else 
+        {
+            extElement = [[CMISExtensionElement alloc] initLeafWithName:self.extensionName 
+                                                           namespaceUri:self.extensionNamespaceUri 
+                                                             attributes:self.extensionAttributes 
+                                                                  value:self.extensionValue];
+        }
+
+        [self.parentDelegate extensionElementParser:self didFinishParsingExtensionElement:extElement];
+        
+        parser.delegate = self.parentDelegate;
+        self.parentDelegate = nil;
+    }
+}
+
+#pragma mark -
+#pragma mark CMISAtomPubExtensionElementParser
+
+- (void)extensionElementParser:(CMISAtomPubExtensionElementParser *)parser didFinishParsingExtensionElement:(CMISExtensionElement *)extensionElement
+{
+    if (self.extensionChildren == nil)
+    {
+        self.extensionChildren = [[NSMutableArray alloc] init];
+    }
+    
+    [self.extensionChildren addObject:extensionElement];
+}
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISAtomPubExtensionElementParser.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,34 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class CMISPropertyDefinition;
+@protocol CMISPropertyDefinitionDelegate;
+
+@interface CMISPropertyDefinitionParser : NSObject <NSXMLParserDelegate>
+
+// Initializes a child parser for an Atom Entry and takes over parsing control while parsing the Atom Entry
++ (id)parserForPropertyDefinition:(NSString *)propertyDefinitionElementName
+               withParentDelegate:(id<NSXMLParserDelegate, CMISPropertyDefinitionDelegate>)parentDelegate
+               parser:(NSXMLParser *)parser;
+
+@end
+
+@protocol CMISPropertyDefinitionDelegate <NSObject>
+
+@optional
+- (void)propertyDefinitionParser:(id)propertyDefinitionParser didFinishParsingPropertyDefinition:(CMISPropertyDefinition *)propertyDefinition;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.h
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.m
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.m?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.m (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.m Wed Dec 26 10:48:33 2012
@@ -0,0 +1,227 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import "CMISPropertyDefinitionParser.h"
+#import "CMISPropertyDefinition.h"
+#import "CMISAtomPubConstants.h"
+
+
+@interface CMISPropertyDefinitionParser ()
+
+@property(nonatomic, strong, readwrite) CMISPropertyDefinition *propertyDefinition;
+@property(nonatomic, strong, readwrite) NSString *currentString;
+
+// Properties if used as child delegate parser
+@property(nonatomic, weak) id <NSXMLParserDelegate, CMISPropertyDefinitionDelegate> parentDelegate;
+
+@end
+
+
+@implementation CMISPropertyDefinitionParser
+
+@synthesize propertyDefinition = _propertyDefinition;
+@synthesize currentString = _currentString;
+@synthesize parentDelegate = _parentDelegate;
+
+- (id)init
+{
+    self = [super init];
+    if (self)
+    {
+        self.propertyDefinition = [[CMISPropertyDefinition alloc] init];
+    }
+    return self;
+}
+
+- (id)initWithPropertyDefinition:(NSString *)propertyDefinitionElementName
+              withParentDelegate:(id <NSXMLParserDelegate, CMISPropertyDefinitionDelegate>)parentDelegate
+              parser:(NSXMLParser *)parser
+{
+    self = [self init];
+    if (self)
+    {
+        self.parentDelegate = parentDelegate;
+
+        // Setting ourself, the entry parser, as the delegate, we reset back to our parent when we're done
+        [parser setDelegate:self];
+
+        // Select type based on element name that is passed
+        if ([propertyDefinitionElementName isEqualToString:kCMISCorePropertyStringDefinition])
+        {
+            self.propertyDefinition.propertyType = CMISPropertyTypeString;
+        }
+        else if ([propertyDefinitionElementName isEqualToString:kCMISCorePropertyIdDefinition])
+        {
+            self.propertyDefinition.propertyType = CMISPropertyTypeId;
+        }
+        else if ([propertyDefinitionElementName isEqualToString:kCMISCorePropertyBooleanDefinition])
+        {
+            self.propertyDefinition.propertyType = CMISPropertyTypeBoolean;
+        }
+        else if ([propertyDefinitionElementName isEqualToString:kCMISCorePropertyDateTimeDefinition])
+        {
+            self.propertyDefinition.propertyType = CMISPropertyTypeDateTime;
+        }
+        else if ([propertyDefinitionElementName isEqualToString:kCMISCorePropertyIntegerDefinition])
+        {
+            self.propertyDefinition.propertyType = CMISPropertyTypeInteger;
+        }
+        else if ([propertyDefinitionElementName isEqualToString:kCMISCorePropertyDecimalDefinition])
+        {
+            self.propertyDefinition.propertyType = CMISPropertyTypeDecimal;
+        }
+    }
+    return self;
+}
+
+#pragma mark Class methods
+
++ (id)parserForPropertyDefinition:(NSString *)propertyDefinitionElementName
+               withParentDelegate:(id <NSXMLParserDelegate, CMISPropertyDefinitionDelegate>)parentDelegate
+                           parser:(NSXMLParser *)parser
+{
+    return [[CMISPropertyDefinitionParser alloc] initWithPropertyDefinition:propertyDefinitionElementName withParentDelegate:parentDelegate parser:parser];
+}
+
+#pragma mark NSXMLParserDelegate methods
+
+- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
+{
+    NSString *cleanedString = [string stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
+    if (!self.currentString)
+    {
+        self.currentString = cleanedString;
+    }
+    else {
+        self.currentString = [self.currentString stringByAppendingString:cleanedString];
+    }
+}
+
+- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
+{
+    if ([elementName isEqualToString:kCMISCorePropertyStringDefinition]
+        || [elementName isEqualToString:kCMISCorePropertyIdDefinition]
+        || [elementName isEqualToString:kCMISCorePropertyBooleanDefinition]
+        || [elementName isEqualToString:kCMISCorePropertyIntegerDefinition]
+        || [elementName isEqualToString:kCMISCorePropertyDateTimeDefinition]
+        || [elementName isEqualToString:kCMISCorePropertyDecimalDefinition])
+    {
+        if (self.parentDelegate)
+        {
+            if ([self.parentDelegate respondsToSelector:@selector(propertyDefinitionParser:didFinishParsingPropertyDefinition:)])
+            {
+                [self.parentDelegate performSelector:@selector(propertyDefinitionParser:didFinishParsingPropertyDefinition:) withObject:self withObject:self.propertyDefinition];
+            }
+
+            // Reset Delegate to parent
+            parser.delegate = self.parentDelegate;
+            self.parentDelegate = nil;
+        }
+    }
+    else if ([elementName isEqualToString:kCMISCoreId])
+    {
+        self.propertyDefinition.id = self.currentString;
+    }
+    else if ([elementName isEqualToString:kCMISCoreLocalName])
+    {
+        self.propertyDefinition.localName = self.currentString;
+    }
+    else if ([elementName isEqualToString:kCMISCoreLocalNamespace])
+    {
+        self.propertyDefinition.localNamespace = self.currentString;
+    }
+    else if ([elementName isEqualToString:kCMISCoreDisplayName])
+    {
+        self.propertyDefinition.displayName = self.currentString;
+    }
+    else if ([elementName isEqualToString:kCMISCoreQueryName])
+    {
+        self.propertyDefinition.queryName = self.currentString;
+    }
+    else if ([elementName isEqualToString:kCMISCoreDescription])
+    {
+        self.propertyDefinition.description = self.currentString;
+    }
+    else if ([elementName isEqualToString:kCMISCoreCardinality])
+    {
+        if ([self.currentString isEqualToString:@"multi"])
+        {
+            self.propertyDefinition.cardinality = CMISCardinalityMulti;
+        }
+        else if ([self.currentString isEqualToString:@"single"])
+        {
+            self.propertyDefinition.cardinality = CMISCardinalitySingle;
+        }
+        else
+        {
+            log(@"Invalid value for property definition cardinality : '%@'", self.currentString);
+        }
+
+    }
+    else if ([elementName isEqualToString:kCMISCoreUpdatability])
+    {
+        if ([self.currentString.lowercaseString isEqualToString:@"readonly"])
+        {
+            self.propertyDefinition.updatability = CMISUpdatabilityReadOnly;
+        }
+        else if ([self.currentString.lowercaseString isEqualToString:@"readwrite"])
+        {
+            self.propertyDefinition.updatability = CMISUpdatabilityReadWrite;
+        }
+        else if ([self.currentString.lowercaseString isEqualToString:@"whencheckedout"])
+        {
+            self.propertyDefinition.updatability = CMISUpdatabilityWhenCheckedOut;
+        }
+        else if ([self.currentString.lowercaseString isEqualToString:@"oncreate"])
+        {
+            self.propertyDefinition.updatability = CMISUpdatabilityOnCreate;
+        }
+        else
+        {
+            log(@"Invalid value for property definition updatability : '%@'", self.currentString);
+        }
+    }
+    else if ([elementName isEqualToString:kCMISCoreInherited])
+    {
+        self.propertyDefinition.isInherited = [self parseBooleanValue:self.currentString];
+    }
+    else if ([elementName isEqualToString:kCMISCoreRequired])
+    {
+        self.propertyDefinition.isRequired = [self parseBooleanValue:self.currentString];
+    }
+    else if ([elementName isEqualToString:kCMISCoreQueryable])
+    {
+        self.propertyDefinition.isQueryable = [self parseBooleanValue:self.currentString];
+    }
+    else if ([elementName isEqualToString:kCMISCoreOrderable])
+    {
+        self.propertyDefinition.isOrderable = [self parseBooleanValue:self.currentString];
+    }
+    else if ([elementName isEqualToString:kCMISCoreOpenChoice])
+    {
+        self.propertyDefinition.isOpenChoice = [self parseBooleanValue:self.currentString];
+    }
+
+    self.currentString = nil;
+}
+
+#pragma mark Helper methods
+
+- (BOOL)parseBooleanValue:(NSString *)value
+{
+    return [value.lowercaseString isEqualToString:@"true"];
+}
+
+
+@end
\ No newline at end of file

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISPropertyDefinitionParser.m
------------------------------------------------------------------------------
    svn:eol-style = native

Added: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h
URL: http://svn.apache.org/viewvc/chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h?rev=1425870&view=auto
==============================================================================
--- chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h (added)
+++ chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h Wed Dec 26 10:48:33 2012
@@ -0,0 +1,34 @@
+/*
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+ */
+
+#import <Foundation/Foundation.h>
+#import "CMISRepositoryInfo.h"
+#import "CMISAtomPubExtensionDataParserBase.h"
+
+@class CMISRepositoryInfoParser;
+
+@protocol CMISRepositoryInfoParserDelegate <NSObject>
+@required
+- (void)repositoryInfoParser:(CMISRepositoryInfoParser *)epositoryInfoParser didFinishParsingRepositoryInfo:(CMISRepositoryInfo *)repositoryInfo;
+@end
+
+
+@interface CMISRepositoryInfoParser : CMISAtomPubExtensionDataParserBase <NSXMLParserDelegate>
+
+@property (nonatomic, strong, readonly) CMISRepositoryInfo *currentRepositoryInfo;
+
+- (id)initRepositoryInfoParserWithParentDelegate:(id<NSXMLParserDelegate, CMISRepositoryInfoParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
++ (id)repositoryInfoParserWithParentDelegate:(id<NSXMLParserDelegate, CMISRepositoryInfoParserDelegate>)parentDelegate parser:(NSXMLParser *)parser;
+
+@end

Propchange: chemistry/objectivecmis/trunk/ObjectiveCMIS/Bindings/AtomPub/AtomPubParser/CMISRepositoryInfoParser.h
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message