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

INServerObject extends INObject in that it represents an XML document tree "belonging" to a given server and is able to perform GET, PUT and POST server calls (and DELETE if you do that manually). More...

#import <INServerObject.h>

Inherits INParentObject.

Inherited by IndivoAbstractDocument, and IndivoRecord.

Instance Methods

(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...
 

Properties

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

- Class Methods inherited from INObject
(NSArray *) + attributeNames
 The properties whose names are returned here are expected to be XML node attributes rather than complete nodes. More...
 
(NSString *) + flatXMLNameForPropertyName:
 Objects have the ability to use a different name from the property name for flat XML "name" attributes. More...
 
(id) + newWithNodeName:
 Returns a fresh node with nodeName set. More...
 
(NSString *) + nodeName
 
(NSString *) + nodeType
 
(id) + objectFromAttribute:inNode:
 This method returns an object created from the string contents of a node attribute. More...
 
(id) + objectFromNode:
 This method returns an object created representing the the node. More...
 
- Protected Attributes inherited from INObject
NSString * _nodeName
 

Detailed Description

INServerObject extends INObject in that it represents an XML document tree "belonging" to a given server and is able to perform GET, PUT and POST server calls (and DELETE if you do that manually).

Method Documentation

- (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.

- (void) get: (NSString *)  aMethod
callback: (INSuccessRetvalueBlock)  callback 

Shortcut for GETting data.

Calls "performMethod:withBody:orParameters:httpMethod:callback:" internally.

Parameters
aMethodThe method to perform, e.g. "/records/id/documents/"
callbackThe callback block to execute when the call has finished
- (void) get: (NSString *)  aMethod
parameters: (NSArray *)  paramArray
callback: (INSuccessRetvalueBlock)  callback 

Shortcut for GETting data with parameters.

Calls "performMethod:withBody:orParameters:httpMethod:callback:" internally.

Parameters
aMethodThe method to perform, e.g. "/records/id/documents/"
paramArrayAn array of NSString parameters in the form "key=value"; will be URL-encoded automatically
callbackThe callback block to execute when the call has finished
- (id) initFromNode: (INXMLNode *)  node
withServer: (IndivoServer *)  aServer 

The designated initializer.

- (BOOL) is: (NSString *)  anId

Shortcut method to test if the document has the given ID.

- (void) markOnServer

Sets onServer to YES for the receiver.

- (void) performMethod: (NSString *)  aMethod
withBody: (NSString *)  body
orParameters: (NSArray *)  parameters
httpMethod: (NSString *)  httpMethod
callback: (INSuccessRetvalueBlock)  callback 

The basic method to perform REST methods on the server with App credentials.

Uses a INServerCall instance to handle the loading; INServerCall only allows a body string or parameters, but not both, with the body string taking precedence.

Parameters
aMethodThe path to call on the server
bodyThe body string
parametersAn array full of strings in the form "key=value"
httpMethodThe http method, for now GET, PUT or POST
callbackA block to execute when the call has finished
- (void) post: (NSString *)  aMethod
body: (NSString *)  bodyString
callback: (INSuccessRetvalueBlock)  callback 

Shortcut for POSTing body data.

Calls "performMethod:withBody:orParameters:httpMethod:callback:" internally.

Parameters
aMethodThe method to perform, e.g. "/records/id/documents/"
bodyStringThe body data to POST
callbackThe callback block to execute when the call has finished
- (void) post: (NSString *)  aMethod
parameters: (NSArray *)  paramArray
callback: (INSuccessRetvalueBlock)  callback 

Shortcut for POSTing parameters.

Calls "performMethod:withBody:orParameters:httpMethod:callback:" internally.

Parameters
aMethodThe method, aka REST-path, to perform
paramArrayAn array full of "key=value" strings; will be URL-encoded automatically
callbackThe callback-block to call when the method has finished
- (void) put: (NSString *)  aMethod
body: (NSString *)  bodyString
callback: (INSuccessRetvalueBlock)  callback 

Shortcut for PUTting data.

Calls "performMethod:withBody:orParameters:httpMethod:callback:" internally.

Parameters
aMethodThe method to perform, e.g. "/records/id/documents/document-id"
bodyStringthe body data to PUT
callbackThe callback block to execute when the call has finished

Property Documentation

- (BOOL) onServer
readnonatomicassign

Indicates whether this document lives on the server.

- (IndivoServer*) server
readwritenonatomicassign

Our beloved server.

- (NSString*) uuid
readwritenonatomicstrong

This object's udid.


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