Indivo Framework (iOS)
An iOS framework for Apps connecting to Indivo server
|
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... | |
IndivoServer * | server |
Our beloved server. More... | |
NSString * | uuid |
This object's udid. More... | |
Additional Inherited Members | |
![]() | |
(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... | |
![]() | |
NSString * | _nodeName |
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).
- (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.
aMethod | The method to perform, e.g. "/records/id/documents/" |
callback | The 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.
aMethod | The method to perform, e.g. "/records/id/documents/" |
paramArray | An array of NSString parameters in the form "key=value"; will be URL-encoded automatically |
callback | The 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.
aMethod | The path to call on the server |
body | The body string |
parameters | An array full of strings in the form "key=value" |
httpMethod | The http method, for now GET, PUT or POST |
callback | A 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.
aMethod | The method to perform, e.g. "/records/id/documents/" |
bodyString | The body data to POST |
callback | The 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.
aMethod | The method, aka REST-path, to perform |
paramArray | An array full of "key=value" strings; will be URL-encoded automatically |
callback | The 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.
aMethod | The method to perform, e.g. "/records/id/documents/document-id" |
bodyString | the body data to PUT |
callback | The callback block to execute when the call has finished |
|
readnonatomicassign |
Indicates whether this document lives on the server.
|
readwritenonatomicassign |
Our beloved server.
|
readwritenonatomicstrong |
This object's udid.