OMCStorageCollection Class Reference

Inherits from NSObject
Declared in OMCStorageCollection.h

Overview

This interface defines the OMCStorageCollection object which contains parameters and public methods to operate on the OMCStorageObjects in the current collection.

  collectionID

Identification of the current OMCStorageCollection in the service.

@property (readonly, nonatomic) NSString *collectionID

Declared In

OMCStorageCollection.h

  collectionDescription

Description of the current OMCStorageCollection in the service.

@property (readonly, nonatomic) NSString *collectionDescription

Declared In

OMCStorageCollection.h

– contains:

Tells if the OMCStorageObject with the key exists in the current OMCStorageCollection. Return YES if it exists, NO otherwise.

- (BOOL)contains:(NSString *)objectID

Parameters

objectID

The ID of the OMCStorageObject to find.

Declared In

OMCStorageCollection.h

– get:withLimit:getAllObjects:

Returns a list of OMCStorageobjects for the StorageCollection starting with the ‘offset’ index, with the count up to but not necessarily including the ‘limit’ count.

- (NSMutableArray *)get:(int)offset withLimit:(int)limit getAllObjects:(BOOL)allObjects

Parameters

offset

The ‘start’ index.

limit

The count.

allObjects

True when a technician gets all the objects in a userIsolated collection, otherwise false.

Discussion

In a shared collection, it always returns the whole objects. In a user-isolated collection, if allObjects is false, then it only returns the objects owned by the current user. In a user-isolated collection, if allObjects is true, then it returns all the objects visible to the current user. The user must have READ_ALL or READ_WRITE_ALL permission.

Declared In

OMCStorageCollection.h

– get:

Fetches and returns the OMCStorageObject in the current OMCStorageCollection. The OMCStorageObject is specified with the key.

- (OMCStorageObject *)get:(NSString *)objectID

Parameters

objectID

The ID of the OMCStorageObject to be fetched.

Declared In

OMCStorageCollection.h

– post:

Creates and uploads an OMCStorageObject to the current OMCStorageCollection. Note that for a POST request, the server will generate an Object ID and ignore the Object ID currently in the current storage object. To preserve the Object ID, use the put: method, even with a new object. Returns the OMCStorageObject.

- (OMCStorageObject *)post:(OMCStorageObject *)storageObject

Parameters

storageObject

The OMCStorageObject to be uploaded.

Declared In

OMCStorageCollection.h

– put:

Uploads a new OMCStorageObject or updates an existing OMCStorageObject in the current OMCStorageCollection. Returns the updated `OMCStorageObject.

- (OMCStorageObject *)put:(OMCStorageObject *)storageObject

Parameters

storageObject

The OMCStorageObject to be uploaded.

Declared In

OMCStorageCollection.h

– deleteWithKey:

Deletes the OMCStorageObject in the OMCStorageCollection. The OMCStorageObject is specified with the key. Return YES if delete is successful.

- (BOOL)deleteWithKey:(NSString *)objectID

Parameters

objectID

The ID of the OMCStorageObject to be deleted.

Declared In

OMCStorageCollection.h

– delete:

Deletes the OMCStorageObject in the OMCStorageCollection. Return YES if delete is successful.

- (BOOL)delete:(OMCStorageObject *)storageObject

Parameters

storageObject

The OMCStorageObject to be deleted.

Declared In

OMCStorageCollection.h