Was this article helpful?

socialize.showEditConnectionsUI

Last modified 11:38, 15 Sep 2014

Description

Displays an Edit Connections plugin, which enables adding connections to social networks and removing existing connections. The plugin is displayed only when the user is logged in.

The plugin displays for each social network to which the user is connected - the user's basic identity information with a "disconnect" option, and logos of all the Social Networks to which the user is not connected as "connect" options.

Currently the plugin displays, by default, the logos of the following providers: Facebook, TwitterYahoo, Microsoft MessengerLinkedInInstagramGoogle+Paypal, FourSquare, Renren, Kaixin, Vkontakte, Odnoklassniki.

You may customize this list using the enabledProviders and disabledProviders parameters. You may also set the requiredCapabilities parameter to login in order to add more providers such as Google+ and AOL. 

Plugin's Default Design:

EditConnectionsUI.gif

The plugin's design is customizable through the use of the parameters listed below.

 

Syntax

gigya.socialize.showEditConnectionsUI(params)

 

 

Method Parameters

The following table lists the params object members:

Required Name Type Description
Optional width integer Determines the width you desire for the plugin.
  height integer Determines the height you desire for the plugin.

containerID string An ID of a <DIV> element on the page in which you want to display the plugin.
If this parameter is not provided then the plugin will be displayed as a popup at the center of the page. Please refer to Dialog or Embedded section for extended explanation.
  captionText string Sets the caption text. This parameter is relevant only when the plugin is in a popup mode (i.e. if the containerID/container parameter is not provided). If the plugin is embedded in the page then the caption is not presented.
  context object A reference to a developer created object that will be passed back unchanged to the event handlers of any event triggered as a consequence of using this plugin. The context object will be passed as one of the fields of the eventObj received by the event handler (see extended explanation in the "Plugin Events" and in the "Global Event Triggered" sections below).
  showTermsLink Boolean Show or hide the "Terms" link. Clicking the "Terms" link opens Gigya's Legal Notices page.
  enabledProviders string A comma-delimited list of provider names to include in the method execution. This parameter gives the possibility to apply this method only to a subset of providers of your choice. If you do not set this parameter, by default all the providers are enabled (i.e. the method applies to all connected providers).
For example, if you would like the method to apply only to Facebook and Twitter, define: enabledProviders: "facebook, twitter".
Valid provider names include: 'facebook', 'twitter', 'yahoo', 'messenger', 'linkedin', 'instagram', 'googleplus', 'paypal', 'foursquare', 'renren', 'kaixin', 'vkontakte', 'yahoojapan', 'odnoklassniki'.
Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
  disabledProviders string A comma-delimited list of provider names to exclude in the method execution. This parameter gives the possibility to specify providers to which that you don't want this method to apply. If you do not set this parameter, by default no provider is disabled (i.e. the method applies to all connected providers).
For example, if you would like the method to apply to all providers except Google+ and Twitter, define: disabledProviders: "googleplus, twitter".
Valid provider names include: 'facebook', 'twitter', 'yahoo', 'messenger', 'linkedin''instagram', 'googleplus', 'paypal', 'foursquare', 'renren', 'kaixin', 'vkontakte', 'yahoojapan', 'odnoklassniki'.
Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
  showTooltips Boolean This parameter's default value is 'false'. If set to 'true', a tooltip will be displayed when mouse hover over a social network icon. The tooltip presents the social network's full name.
  requiredCapabilities string A comma separated list of any of the following capabilities: Login, Notifications, Actions, Friends, Status, Photos, Contacts. Only providers that are available and support all the required capabilities will be visible.
The default required capability is: 'friends'.
You can set the requiredCapabilities parameter to login in order to add more providers such as Google+ and AOL. 
  sessionExpiration integer This parameter defines the time in seconds that Gigya should keep the social network session valid for the user. To end the session when the browser closes, please assign the value '0'. If this parameter is not specified, the session will be valid forever.
  cid string A string of maximum 100 characters length. The CID sets categories for transactions that can be used later for filtering reports generated by Gigya in the "Context ID" combo box. The CID allows you to associate the report information with your own internal data. For example, to identify a specific widget or page on your site/application. You should not define more than 100 different context IDs.
Note: the value of this parameter overrides the value of the identical parameter in the global configuration object.
  actionAttributes JSON object In Gamification your users receive points for actions they perform on your site, in this case editing a connection grants the user points. Action Attributes may be used to annotate actions with additional information, such as the section of the web site that generated the action. If you set here the actionAttributes, each time a user edits a connection, the action also receives an attribute, for example "tv-show":"glee", which can mean that the action was performed on the "Glee" page of the site. 
actionAttributes contain a JSON object comprised of a series of attribute keys (categories) with associated values. You can also use a generic "tags" key. No more than three values can be given, they can be with a single key or each have their own key. For more information see Variants and Action Attributes. Action attributes are later used to filter GM Plugins by a certain attribute.
Example:  {"<attribute key1>": ["<attribute value1>", "<attribute value2>"],  "<attribute key2>": "<attribute value3>" }
  useHTML Boolean Deprecated. The Login plugin is available in both Flash and HTML versions. By default, the HTML version is used. You may override the default behavior. Setting this parameter with the value 'false', will force Gigya to use the Flash version.
  onLoad function ref A reference to an event handler function that will be called when the plugin has finished drawing itself.
  onError function ref A reference to an event handler function that will be called when an error occurs.
  onClose function ref A reference to an event handler function that will be called  in one of the following scenarios:
  • If the Plugin is displayed as a popup the event will be fired when the Plugin is closing.
  • If the Plugin is embedded in page the event will be fired when the user clicks a button that indicates the dialog should be closed. In this case the dialog will not hide itself automatically.

 

Plugin Events

An Event Handler is a JavaScript function with the following signature:

functionName(eventObj)

The single argument, eventObj, contains information about the event and has different fields for different events.

The following tables specify the list of fields available in the eventObj for each event:

 

onLoad Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.

 

onError Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.
errorCode integer The result code of the operation. Code '0' indicates success, any other number indicates failure. For a complete list of error codes, see the Error Codes table.
errorMessage string A short textual description of an error, associated with the errorCode, for logging purposes.
errorDetails string This field will contain the exception info, if available.

 

onClose Event Data

Field Type Description
eventName string The name of the event.
sourcestringThe source plugin that generated this event. The value of this field is the name of the plugin's API method, e.g. 'showLoginUI', 'showCommentsUI', etc.
context object The context object passed by the application as parameter to the API method, or null if no context object has been passed.

 

 

Global Event handlers Triggered

By using this Plugin, the following global events may be triggered: onConnectionAdded and onConnectionRemoved.
The onLogin event may be fired if the connectWithoutLoginBehavior parameter is used. Read more in Add Connections without Logging-in.

To register an event handler use the socialize.addEventHandlers API method. Refer to the onConnectionAdded and onConnectionRemoved event data. Refer to the Events page in the Developer's Guide - to learn more about how to handle events generated by Gigya socialize.

Code Sample

var context = {
    msg:'This is my params.context.msg'
};	

var params = { 
    captionText:'This is my caption text',
    showTermsLink:false,
    context:context
};

params['onLoad'] = function(evt) {              
    evt['msg'] = 'After onLoad';
    var msg = 'Event name is : ' + evt.eventName +'\n';
    msg+= 'evt[\'msg\'] is : ' + evt['msg']+'\n';
    msg+= 'context.msg is : ' + evt['context']['msg'];            
    alert(msg);
};

gigya.socialize.showEditConnectionsUI(params);
Notes:
    a. This sample is not meant to be fully functional code. For brevity's sake, only the code required for demonstrating the API call itself is presented.
    b. The API key in the sample will only work on http://localhost/...
        Please modify this and insert your own domain, if you would like to test this code in any other environment.
    c. Best practice is, to define one global configuration object and use it throughout the application.
Was this article helpful?
Page statistics
268 view(s) and 2 edit(s)
Social share
Share this page?

Tags

This page has no custom tags.
This page has no classifications.

Comments

You must to post a comment.

Attachments