My favorites | English | Sign in

Google Desktop APIs (Labs)

google.pers.ranking.RankableItem

SUMMARY: PROPERTY | METHOD     DETAIL: PROPERTY | METHOD

Class google.pers.ranking.RankableItem

Defines an object that can be ranked based on the user's click statistics. To create a rankable item, use the ranking method createRankableItem():

var rankItem = google.pers.ranking.createRankableItem();

Before you use a rankable item, you must set its identifier (identifier) and profile (updateRankingProfile()). For details and sample code, see the Personalization API Developer Guide.

Each rankable item has four attributes, the values of which are used when items are ranked. For details, see Attributes that Affect Ranking.

See also: google.pers.ranking

Property Summary

object identifier
The unique identifier of this rankable item.
 

Method Summary

incrementClicksAndUpdateClickedTime(num_clicks)
Increments the number of clicks on the item and updates the last-clicked time for the item.
rankType(flag)
Determines whether this item is always at the top or bottom.
resetStatistics()
Resets the statistics stored in the item.
updateAttributeValue(name, value)
Sets the value of the specified ranking attribute for the item.
updateItemOpenDuration(start_duration)
Updates the time duration that the item was open for.
updateRankingProfile(data_source_id, user_profile)
Specifies the user profile and data source identifier for this item.
 

Property Detail

identifier

object identifier
    The unique identifier of this rankable item. This property allows you to find an item both before and after ranking.

Method Detail

incrementClicksAndUpdateClickedTime

incrementClicksAndUpdateClickedTime(num_clicks)
    Increments the number of clicks on the item and updates the last-clicked time for the item.
    Parameters:
      integer num_clicks - The number of clicks to increment by

rankType

rankType(flag)
    Determines whether this item is always at the top or bottom.
    Parameters:
      integer flag - A constant defined by contentRankingFlag — for example, contentRankingFlag.AlwaysBottom

resetStatistics

resetStatistics()
    Resets the statistics stored in the item. The number of clicks and last-clicked time are set to zero; all attributes are cleared.

updateAttributeValue

updateAttributeValue(name, value)
    Parameters:
      object value - The new value of the attribute

updateItemOpenDuration

updateItemOpenDuration(start_duration)
    Updates the time duration that the item was open for. Upon being called with an argument value of false, this method updates the "ItemOpenDuration" attribute of the item with the amount of time that has passed since the method was most recently invoked with an argument value of true.

    To update the duration, invoke this method twice, as shown in the following example.

    //When opening the item:
    updateItemOpenDuration(true);
    ...
    //When closing the item:
    updateItemOpenDuration(false);
    
    Parameters:
      boolean start_duration - Specify true to indicate that the item is open; specify false to indicate that the item is closed

updateRankingProfile

updateRankingProfile(data_source_id, user_profile)
    Specifies the user profile and data source identifier for this item. If you don't group items by data source, use the same data source identifier for all items — for example, 1.
    Parameters:
      integer data_source_id - An arbitrary integer used to identify the source of the data associated with this item
      object user_profile - An object returned by the createProfile() method of google.pers.ranking; all items in the same gadget should use the same profile object

Back to top

Documentation generated by JsDoc Toolkit 1.3.3