| AppliBuilder
User Documentation |
Each application can use framework
support to send notification(s) to users of the application.
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.sendNotification("username", "message to user", callbackFunction);
// OR
// ajaxdb.sendNotification("username", "message to user", callbackFunction, async);
// last argument is asynchronous or synchronous which is optional, default is async
function callbackFunction(params, error) {
// Notification was sent.
}
NOTE: You can pass list of username as opposed to one username.
CallbackFunction? will be passed with two arguments, the first one (params) is list of username's to whom the notification was successfully sent, the second one (error) which is Error instance if the notification failed.
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.sendEmailNotification("username", "message to user", callbackFunction);
...
This API is similar to sendNotification except that it sends notification to user email if user exist and is not blocked.
File format is similar to Java's Properties file. You can specify the following in it (Which overrides the default)
# Activation Mail Subject That Will be used
mail.activate.subject = ApplicationName Account Activation
# Activation Mail Message, ${user}, ${activationURL} will be replaced with appropriate values at runtime.
mail.activate.message = Hi ${user}, \n You can activate the application using the link: ${activateURL}
# Message format of mail, text or html, THIS WILL BE USED FOR ACTIVATION MAIL (MAIL SENT DURING REGISTRATION)
mail.activate.msgformat = text
# Message format of mail, text or html, THIS WILL BE USED WHEN NOTIFICATION IS SENT FROM APPLICATION
mail.message.format = text
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.getNotification("username", callbackFunction);
// OR
// ajaxdb.getNotification("username", callbackFunction, async);
// last argument is asynchronous or synchronous which is optional, default is async
function callbackFunction(notifications) {
// notifications is list of notification information instance
ajaxdb.renderNotification(notifications, document.body); // Utility function to display notification informations.
}
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.deleteNotification(notificationid, callbackFunction);
// OR
// ajaxdb.deleteNotification(notificationid, callbackFunction, async);
// last argument is asynchronous or synchronous which is optional, default is async
function callbackFunction(params, error) {
// Notification was deleted
}
You can delete list of notifications by its id.
CallbackFunction? will be passed with two arguments, the first one (params) is list of notification id's which were deleted, the second one (error) which is Error instance if the notification failed.
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.deleteNotification([notificationid1, notificationid2...], callbackFunction);
Example:
notificationInfo.markAsRead(callbackFunction); // Will mark the notification instance as read.
function callbackFunction() {
// Notification was marked as read
}
You can also set the status by using the notification id.
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.markNotification(notificationid, "R", callbackFunction);
// OR
// ajaxdb.markNotification(notificationid, "R", callbackFunction, async);
// last argument is asynchronous or synchronous which is optional, default is async
function callbackFunction() {
// Notification was marked as read
}
You can mark set of notifications by its id.
CallbackFunction? will be passed with two arguments, the first one (params) is list of notification id's which were marked, the second one (error) which is Error instance if the notification failed.
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.markNotification([notificationid1, notificationid2...], "R", callbackFunction);
mark flag can be any one of ("R", "U", "I", "T") as described above.
Example:
var ajaxdb = new Applibase.db.AjaxDb();
ajaxdb.getNotificationByStatus(username, markFlag, callbackFunction, async);
// OR
// ajaxdb.getNotificationByStatus(username, markFlag, callbackFunction, async);
function callbackFunction(notifications, error) {
// notifications is the list of NotificationInfo instance
}
| ©
2006 Applibase, Inc. |