account_template.json

Each Synergy service that wants to interact with the Account Manager service stores a file containing callbacks and metadata in /usr/palm/public/accounts. At Account service start-up, this file is scanned and registered.

Third-party apps creating services that interact with the Account Manager are required to be packaged with an account-template.json file containing this object along with accompanying metadata such as account icons and localized text.

Schema

{
    "templateId"            : string,
    "loc_name"              : string,
    "loc_usernameLabel"     : string,
    "loc_passwordLabel"     : string,
    "icon"                  : IconObj,
    "hidden"                : boolean,
    "invisible"             : boolean,
    "config"                : any, 
    "validator"             : string | CustomValidatorObj object, 
    "readPermissions"       : string array,
    "writePermissions"      : string array,
    "onCapabilitiesChanged" : string, 
    "onCredentialsChanged"  : string, 
    "disableRemove"         : boolean,
    "capabilityProviders"   : capability array
    ... other user-defined fields ...
}

Properties

Property Required Type Description
templateId Yes string Template ID.
loc_name Yes string Localizable name, i.e., "Google".
loc_usernameLabel No string Localizable username field label. For example: "Email Address". Default is "Username".
loc_usernameLabel No string Localizable password field label. For example: "PIN:. Default is "Password".
icon No IconObj Location of app's icons.
hidden No boolean Default is false. Hides it from "Add Accounts".
invisible No boolean Default is false. Inplies hidden = true. Hides it from ALL account lists.
config No any Opaque configuration objects sent to validator. Typically, this is populated with server configuration data.
validator No string Callback or CustomValidatorObj
readPermissions Yes string array Array of IDs of apps that can read account or credential information. Specifically, this means they are allowed to make the following calls: getAccountInfo and readCredentials.
writePermissions No string array Array of IDs of apps that can create or modify account information and credentials. Specifically, this means they are allowed to make the following calls: createAccount, deleteAccount, modifyAccount and writeCredentials. If omitted, then only the Accounts app can make these calls.
onCapabilitiesChanged No string Method to call when account capabilities change.
onCredentialsChanged No string Method to call when account credentials change.
disableRemove No boolean Should users be allowed to remove this account flag. Default is true.
capabilityProviders Yes capability array Account capabilities

Example

{
   "templateId":"com.palm.google",
   "loc_name":"Google",
   "icon":{
      "loc_32x32":"images/google-32x32.png",
      "loc_48x48":"images/google-48x48.png"
   },
   "validator":"palm://com.palm.service.contacts.google/checkCredentials",
   "capabilityProviders":[
      {
         "capability":"CONTACTS",
         "id":"com.palm.google.contacts",
         "loc_name":"Google Contacts",
         "implementation":"palm://com.palm.service.contacts.google/",
         "onCreate":"palm://com.palm.service.contacts.google/onCreate",
         "onEnabled":"palm://com.palm.service.contacts.google/onEnabled",
         "onDelete":"palm://com.palm.service.contacts.google/onDelete"
      },
      {
         "capability":"MESSAGING",
         "capabilitySubtype":"IM",
         "id":"com.palm.google.talk",
         "loc_name":"Google Talk",
         "icon":{
            "loc_32x32":"images/gtalk32x32.png",
            "loc_48x48":"images/gtalk48x48.png",
            "splitter":"images/gtalk_transport_splitter.png"
         },
         "implementation":"palm://com.palm.imlibpurple/",
         "onEnabled":"palm://com.palm.imlibpurple/onEnabled",
         "serviceName":"service_gtalk",
         "dbkinds":{
            "immessage":"com.palm.immessage.libpurple",
            "imcommand":"com.palm.imcommand.libpurple"
         }
      }
   ]
}