Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
 All Classes Functions Variables Properties Pages
Instance Methods | Class Methods | Properties | List of all members
IndivoAbstractDocument Class Reference

An abstract superclass to all Indivo Documents as well as Indivo Metadata. More...

#import <IndivoAbstractDocument.h>

Inherits INServerObject.

Inherited by IndivoDocument, and IndivoMetaDocument.

Instance Methods

(NSString *) - documentXML
 Returns an XML representation of the receiver, like "xml" does, but adds namespace information. More...
 
(NSString *) - flatDocumentXML
 Returns the Indivo 2.0 flat XML format for a document. More...
 
(NSString *) - flatXML
 Returns the Indivo 2.0 flat XML format. More...
 
(id) - initFromNode:forRecord:
 The designated initializer, initializes an instance from an XML node. More...
 
- Instance Methods inherited from INServerObject
(void) - forceNotOnServer
 This is provided for subclasses, the fact that onServer is readonly but settable by this and markOnServer underlines the fact that you should only change this property when you know what you're doing. More...
 
(void) - get:callback:
 Shortcut for GETting data. More...
 
(void) - get:parameters:callback:
 Shortcut for GETting data with parameters. More...
 
(id) - initFromNode:withServer:
 The designated initializer. More...
 
(BOOL) - is:
 Shortcut method to test if the document has the given ID. More...
 
(void) - markOnServer
 Sets onServer to YES for the receiver. More...
 
(void) - performMethod:withBody:orParameters:httpMethod:callback:
 The basic method to perform REST methods on the server with App credentials. More...
 
(void) - post:body:callback:
 Shortcut for POSTing body data. More...
 
(void) - post:parameters:callback:
 Shortcut for POSTing parameters. More...
 
(void) - put:body:callback:
 Shortcut for PUTting data. More...
 

Class Methods

(Class) + classForProperty:
 Returns the class of a property from the property map dictionary. More...
 
(NSString *) + nameSpace
 
(id) + newWithRecord:
 To get a new instance that must be pushed to the server. More...
 
(NSDictionary *) + propertyClassMapper
 The automatically generated IndivoDocument subclasses return a dictionary with property->class mappings. More...
 
(BOOL) + useFlatXMLFormat
 Implementing this to have some flexibility about the XML format to use on the road to Indivo 2.0, default implementation returns YES. More...
 

Properties

IndivoCreated * created
 
NSString * nameSpace
 The namespace. More...
 
IndivoRecordrecord
 The owning record. If you change this on documents fetched from the server, you will get errors. More...
 
IndivoSuppressed * suppressed
 
- Properties inherited from INServerObject
BOOL onServer
 Indicates whether this document lives on the server. More...
 
IndivoServerserver
 Our beloved server. More...
 
NSString * uuid
 This object's udid. More...
 

Additional Inherited Members

- Protected Attributes inherited from INObject
NSString * _nodeName
 

Detailed Description

An abstract superclass to all Indivo Documents as well as Indivo Metadata.

This class can auto-generate its XML from its direct properties, so you don't need to write your own "xml" method implementation in subclasses unless the auto-generated XML is not the one you want.

Method Documentation

+ (Class) classForProperty: (NSString *)  propertyName

Returns the class of a property from the property map dictionary.

- (NSString *) documentXML

Returns an XML representation of the receiver, like "xml" does, but adds namespace information.

You should use this method to generate an XML representation for the document, "xml" will be used for sub-documents.

Returns
An XML document representation of the receiver including the xml version and encoding header
- (NSString *) flatDocumentXML

Returns the Indivo 2.0 flat XML format for a document.

Attention
HIGHLY PRELIMINARY
- (NSString *) flatXML

Returns the Indivo 2.0 flat XML format.

Attention
HIGHLY PRELIMINARY
- (id) initFromNode: (INXMLNode *)  node
forRecord: (IndivoRecord *)  aRecord 

The designated initializer, initializes an instance from an XML node.

Attention
This initializer assumes that the document comes from the server and sets "onServer" to YES IF (and only if) the provided node is not nil.
+ (NSString *) nameSpace
+ (id) newWithRecord: (IndivoRecord *)  aRecord

To get a new instance that must be pushed to the server.

+ (NSDictionary *) propertyClassMapper

The automatically generated IndivoDocument subclasses return a dictionary with property->class mappings.

This is important for NSArray properties to determine the class of the array items.

+ (BOOL) useFlatXMLFormat

Implementing this to have some flexibility about the XML format to use on the road to Indivo 2.0, default implementation returns YES.

Property Documentation

- (IndivoCreated*) created
readwritenonatomicstrong
- (NSString *) nameSpace
readwritenonatomiccopy

The namespace.

Original Indivo documents don't need to overwrite this method, the namespace stays.

The instance method simply forwards the class method if no instance nameSpace has been set.

- (IndivoRecord*) record
readwritenonatomicassign

The owning record. If you change this on documents fetched from the server, you will get errors.

- (IndivoSuppressed*) suppressed
readwritenonatomicstrong

The documentation for this class was generated from the following files: