Provides methods for accessing ArrowDB posts.
This example creates a new post and checks the response.
Cloud.Posts.create({
content: 'Man Walks On Moon',
title: 'News of the day',
photo: Titanium.Filesystem.getFile('photo.jpg')
}, function (e) {
if (e.success) {
var post = e.posts[0];
alert('Success:\n' +
'id: ' + post.id + '\n' +
'title: ' + post.title + '\n' +
'content: ' + post.content + '\n' +
'updated_at: ' + post.updated_at);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example retrieves information about a post and checks the response.
Cloud.Posts.show({
post_id: savedPostId
}, function (e) {
if (e.success) {
var post = e.posts[0];
alert('Success:\n' +
'id: ' + post.id + '\n' +
'title: ' + post.title + '\n' +
'content: ' + post.content + '\n' +
'updated_at: ' + post.updated_at);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example requests a list of posts and checks the response.
Cloud.Posts.query({
page: 1,
per_page: 20,
where: {
reviews_count: { '$gt': 1.0 }
}
}, function (e) {
if (e.success) {
alert('Success:\n' +
'Count: ' + e.posts.length);
for (var i = 0; i < e.posts.length; i++) {
var post = e.posts[i];
alert('id: ' + post.id + '\n' +
'id: ' + post.id + '\n' +
'title: ' + post.title + '\n' +
'content: ' + post.content + '\n' +
'updated_at: ' + post.updated_at);
}
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example updates a post and checks the response.
Cloud.Posts.update({
post_id: savedPostId,
title: 'Lunar Eclipse'
}, function (e) {
if (e.success) {
var post = e.posts[0];
alert('Success:\n' +
'id: ' + post.id + '\n' +
'title: ' + post.title + '\n' +
'content: ' + post.content + '\n' +
'updated_at: ' + post.updated_at);
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
This example deletes a post and checks the response.
Cloud.Posts.remove({
post_id: savedPostId
}, function (e) {
if (e.success) {
alert('Success');
} else {
alert('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
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
.
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
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.
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.
A dictionary of properties to apply.
Create a post.
Requires user login.
See Posts: Create Post for the request parameters supported by this method.
Data is returned in the posts
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Retrieve a list of posts with sorting and pagination.
See Posts: Custom Query Posts for the request parameters supported by this method.
Data is returned in the posts
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Delete a post.
Requires user login.
See Posts: Delete a Post for the request parameters supported by this method.
Parameters to send in the request.
Callback function to execute when the method completes.
Sets the value of the bubbleParent property.
New value for the property.
Sets the value of the lifecycleContainer property.
New value for the property.
Retrieve information about a post.
See Posts: Show a Post for the request parameters supported by this method.
Data is returned in the posts
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.
Update the information for a post.
Requires user login.
See Posts: Update a Post for the request parameters supported by this method.
Data is returned in the posts
property of the parameter passed to the callback.
Parameters to send in the request.
Callback function to execute when the method completes.