From WebOS101
Creating Accounts for your application using Synergy
InitializingSceneAssistant.prototype.createProfileAccount = function() {
this.controller.serviceRequest('palm://com.palm.accounts/crud',
{ method: 'createAccount',
parameters: {
// Note if you are connecting to the cloud this should be the input from the user
username: "user",
// This will be the domain shown in the Synergy profile it automatically format username@domain then appends.com
domain: "yourdomain",
// The displayName: is the value that shows up on the synergy accounts
displayName: "Synergy My Account",
// The dataTypes: specifies what type of synergy access this profile will have.
dataTypes: ["CONTACTS", "CALENDAR"],
isDataReadOnly: false,
// The icons: secion ** Note this can cause your synergy account not to create. It needs all of these icons to be valid or
// the account create can return an error.
icons: {
"32x32": Mojo.appPath + "images/logo_32.png",
"32x32CALENDAR": Mojo.appPath + "images/logo_32.png",
"32x32CONTACTS": Mojo.appPath + "images/logo_32.png",
"48x48": Mojo.appPath + "images/logo_48.png",
"48x48CALENDAR": Mojo.appPath + "images/logo_32.png",
"48x48CONTACTS": Mojo.appPath + "images/logo_32.png"
}
},
onSuccess: this.accountCreated.bind(this),
onFailure: this.accountCreateFailed.bind(this)
});
}
// Now create success and error handlers so it can process on completion or log errors
InitializingSceneAssistant.prototype.accountCreated = function(result) {
this.accountId = result.accountId;
Mojo.Log.info("Account ID: " + result.accountId);
}
InitializingSceneAssistant.prototype.accountCreateFailed = function(response) {
Mojo.Log.error("Account create failed" + response.errorText)
}