Modules.Cloud.PhotoCollections
> Modules.Cloud.PhotoCollections

Provides methods for ArrowDB photo collections.

Examples

Create Photo Collection

This example creates a new photo collection and checks the response.

Cloud.PhotoCollections.create({
    name: 'Party Pictures'
}, function (e) {
    if (e.success) {
        var collection = e.collections[0];
        alert('Success:\n' +
            'id: ' + collection.id + '\n' +
            'name: ' + collection.name + '\n' +
            'count: ' + collection.counts.total_photos + '\n'
            'updated_at: ' + collection.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show a Photo Collection

This example retrieves information about a photo collection and checks the response.

Cloud.PhotoCollections.show({
    collection_id: savedPhotoCollectionId
}, function (e) {
    if (e.success) {
        var collection = e.collections[0];
        alert('Success:\n' +
            'id: ' + collection.id + '\n' +
            'name: ' + collection.name + '\n' +
            'count: ' + collection.counts.total_photos + '\n'
            'updated_at: ' + collection.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Search for Photo Collections

This example searches for collections and checks the response.

Cloud.PhotoCollections.search({
    user_id: savedUserId
}, function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.collections.length);
        for (var i = 0; i < e.collections.length; i++) {
            var collection = e.collections[i];
            alert('Success:\n' +
                'id: ' + collection.id + '\n' +
                'name: ' + collection.name + '\n' +
                'count: ' + collection.counts.total_photos + '\n'
                'updated_at: ' + collection.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Photo Subcollections

This example requests a list of photo subcollections and checks the response.

Cloud.PhotoCollections.showSubcollections({
    page: 1,
    per_page: 20,
    collection_id: savedCollectionId
}, function (e) {
    if (e.success) {
        alert('Success:\n' +
            'Count: ' + e.collections.length);
        for (var i = 0; i < e.collections.length; i++) {
            var collection = e.collections[i];
            alert('Success:\n' +
                'id: ' + collection.id + '\n' +
                'name: ' + collection.name + '\n' +
                'count: ' + collection.counts.total_photos + '\n'
                'updated_at: ' + collection.updated_at);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Show Photo Collection Photos

This example requests a list of photos in a photo collections and checks the response.

Cloud.PhotoCollections.showPhotos({
    page: 1,
    per_page: 20,
    collection_id: savedCollectionId
}, function (e) {
    if (e.success) {
        if (!e.photos) {
            alert('Success: No photos');
        } else {
            alert('Success:\n' +
                'Count: ' + e.collections.length);
            for (var i = 0; i < e.collections.length; i++) {
                var collection = e.collections[i];
                alert('Success:\n' +
                    'id: ' + collection.id + '\n' +
                    'name: ' + collection.name + '\n' +
                    'count: ' + collection.counts.total_photos + '\n'
                    'updated_at: ' + collection.updated_at);
            }
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Update a Photo Collection

This example updates a photo collection and checks the response.

Cloud.PhotoCollections.update({
    collection_id: savedPhotoCollectionId,
    cover_photo_id: savedPhotoId
}, function (e) {
    if (e.success) {
        var collection = e.collections[0];
        alert('Success:\n' +
            'id: ' + collection.id + '\n' +
            'name: ' + collection.name + '\n' +
            'count: ' + collection.counts.total_photos + '\n'
            'updated_at: ' + collection.updated_at);
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});

Remove a Photo Collection

This example deletes a photo collection and checks the response.

Cloud.PhotoCollections.remove({
    collection_id: savedPhotoCollectionId
}, function (e) {
    if (e.success) {
        alert('Success');
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});
  • 0.8
  • 0.8
  • 0.8
Defined By

Properties

apiName : Stringreadonly

The name of the API that this proxy corresponds to.

The name of the API that this proxy corresponds to.

The value of this property is the fully qualified name of the API. For example, Button returns Ti.UI.Button.

  • 3.2.0
  • 3.2.0
  • 3.2.0
Indicates if the proxy will bubble an event to its parent. ...

Indicates if the proxy will bubble an event to its parent.

Some proxies (most commonly views) have a relationship to other proxies, often established by the add() method. For example, for a button added to a window, a click event on the button would bubble up to the window. Other common parents are table sections to their rows, table views to their sections, and scrollable views to their views. Set this property to false to disable the bubbling to the proxy's parent.

Default: true

  • 3.0.0
  • 3.0.0
  • 3.0.0

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

The Window or TabGroup whose Activity lifecycle should be triggered on the proxy.

If this property is set to a Window or TabGroup, then the corresponding Activity lifecycle event callbacks will also be called on the proxy. Proxies that require the activity lifecycle will need this property set to the appropriate containing Window or TabGroup.

  • 3.6.0
Defined By

Methods

Applies the properties to the proxy. ...

Applies the properties to the proxy.

Properties are supplied as a dictionary. Each key-value pair in the object is applied to the proxy such that myproxy[key] = value.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • props : Dictionary

    A dictionary of properties to apply.

Returns

  • void
Modules.Cloud.PhotoCollections
( parameters, callback )
Creates a photo collection. ...

Creates a photo collection.

Requires user login.

See Photo Collections: Create a Photo Collection for the request parameters supported by this method.

Data is returned in the collections property of the parameter passed to the callback.

Parameters

Returns

  • void
Gets the value of the apiName property. ...

Gets the value of the apiName property.

  • 3.2.0
  • 3.2.0
  • 3.2.0

Returns

  • String
Gets the value of the bubbleParent property. ...

Gets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Returns

  • Boolean
Gets the value of the lifecycleContainer property. ...

Gets the value of the lifecycleContainer property.

  • 3.6.0

Returns

Modules.Cloud.PhotoCollections
( parameters, callback )
Deletes an empty collection. ...

Deletes an empty collection.

Requires user login.

See Photo Collections: Delete a Photo Collection for the request parameters supported by this method.

Parameters

Returns

  • void
Sets the value of the bubbleParent property. ...

Sets the value of the bubbleParent property.

  • 3.0.0
  • 3.0.0
  • 3.0.0

Parameters

  • bubbleParent : Boolean

    New value for the property.

Returns

  • void
Sets the value of the lifecycleContainer property. ...

Sets the value of the lifecycleContainer property.

  • 3.6.0

Parameters

Returns

  • void
Modules.Cloud.PhotoCollections
( parameters, callback )
Retrieves details about a photo collection. ...

Retrieves details about a photo collection.

See Photo Collections: Show a Photo Collection for the request parameters supported by this method.

Data is returned in the collections property of the parameter passed to the callback.

Parameters

Returns

  • void
Modules.Cloud.PhotoCollections
( parameters, callback )
Retrieves photos in a collection. ...

Retrieves photos in a collection.

See PhotoCollections: Show Photos for the request parameters supported by this method.

Data is returned in the photos property of the parameter passed to the callback.

Parameters

Returns

  • void
Modules.Cloud.PhotoCollections
( parameters, callback )
Retrieves a list of subcollections of a collection. ...

Retrieves a list of subcollections of a collection.

See Collections: Show Subcollections for the request parameters supported by this method.

Data is returned in the collections property of the parameter passed to the callback.

Parameters

Returns

  • void
Modules.Cloud.PhotoCollections
( parameters, callback )
Updates a photo collection. ...

Updates a photo collection.

Requires user login.

See Photo Collections: Update a Photo Collection for the request parameters supported by this method.

Data is returned in the collections property of the parameter passed to the callback.

Parameters

Returns

  • void