Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIMicrosummaryService

This interface provides methods for managing installed microsummaries, and the bookmarks they apply to.
1.0
28
Introduced
Gecko 1.8
Obsolete
Gecko 6.0
Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3)

Warning: Microsummary support was removed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)

Implemented by: @mozilla.org/microsummary/service;1 as a service:

var microsummaryService = Components.classes["@mozilla.org/microsummary/service;1"]
                          .getService(Components.interfaces.nsIMicrosummaryService);

Method overview

void addGenerator(in nsIURI generatorURI);
nsIMicrosummary createMicrosummary(in nsIURI pageURI, in nsIURI generatorURI);
nsISimpleEnumerator getBookmarks();
nsIMicrosummaryGenerator getGenerator(in nsIURI generatorURI);
nsIMicrosummarySet getMicrosummaries(in nsIURI pageURI, in long long bookmarkID);
nsIMicrosummary getMicrosummary(in long long bookmarkID);
boolean hasMicrosummary(in long long bookmarkID);
nsIMicrosummaryGenerator installGenerator(in nsIDOMDocument xmlDefinition);
boolean isMicrosummary(in long long bookmarkID, in nsIMicrosummary microsummary);
nsIMicrosummary refreshMicrosummary(in long long bookmarkID);
void removeMicrosummary(in long long bookmarkID);
void setMicrosummary(in long long bookmarkID, in nsIMicrosummary microsummary);

Methods

addGenerator()

Install the microsummary generator from the resource at the supplied URI. Callable by content via nsISidebar.addMicrosummaryGenerator().

void addGenerator(
  in nsIURI generatorURI
);
Parameters
generatorURI
The URI of the resource providing the generator.

Requires Gecko 1.9 (Firefox 3)

createMicrosummary()

Create a microsummary for a given page URI and generator URI.

nsIMicrosummary createMicrosummary(
  in nsIURI pageURI,
  in nsIURI generatorURI
);
Parameters
pageURI
The URI of the page to be summarized.
generatorURI
The URI of the microsummary generator.
Return value

Returns an nsIMicrosummary for the given page and generator URIs.

getBookmarks()

Get the set of bookmarks with microsummaries. In the old RDF-based bookmarks datastore, bookmark IDs are nsIRDFResource objects. In the new Places-based datastore, they are nsIURI objects.

nsISimpleEnumerator getBookmarks();
Parameters

None.

Return value

Returns an nsISimpleEnumerator enumeration of bookmark IDs.

Requires Gecko 1.9 (Firefox 3)

getGenerator()

Return a microsummary generator for the given URI.

nsIMicrosummaryGenerator getGenerator(
  in nsIURI generatorURI
);
Parameters
generatorURI
The URI of the generator.
Return value

Returns an nsIMicrosummaryGenerator for the given URI.

getMicrosummaries()

Get the set of microsummaries available for a given page. The set might change after this method returns, since this method will trigger an asynchronous load of the page in question (if it isn't already loaded) to see if it references any page-specific microsummaries.

If the caller passes a bookmark ID, and one of the microsummaries is the current one for the bookmark, this method will retrieve content from the datastore for that microsummary, which is useful when callers want to display a list of microsummaries for a page that isn't loaded, and they want to display the actual content of the selected microsummary immediately (rather than after the content is asynchronously loaded).

nsIMicrosummarySet getMicrosummaries(
  in nsIURI pageURI,
  in long long bookmarkID Optional
);
Parameters
pageURI
The URI of the page for which to retrieve available microsummaries.
bookmarkID Optional
The ID of the bookmark for which this method is being called.
Return value

Returns an nsIMicrosummarySet of nsIMicrosummaries for the given page.

getMicrosummary()

Get the current microsummary for the given bookmark.

nsIMicrosummary getMicrosummary(
  in long long bookmarkID
);
Parameters
bookmarkID
The bookmark for which to get the current microsummary.
Return value

Returns the current microsummary for the bookmark, or null if the bookmark does not have a current microsummary.

hasMicrosummary()

Whether or not the given bookmark has a current microsummary.

boolean hasMicrosummary(
  in long long bookmarkID
);
Parameters
bookmarkID
The bookmark for which to set the current microsummary.
Return value

Returns a boolean representing whether or not the given bookmark has a current microsummary.

installGenerator()

Install the microsummary generator in the given XML definition.

nsIMicrosummaryGenerator installGenerator(
  in nsIDOMDocument xmlDefinition
);
Parameters
xmlDefinition
An nsIDOMDocument XML document defining the generator.
Return value

Returns the nsIMicrosummaryGenerator that was installed.

isMicrosummary()

Reports whether or not the given microsummary is the current microsummary for the given bookmark.

boolean isMicrosummary(
  in long long bookmarkID,
  in nsIMicrosummary microsummary
);
Parameters
bookmarkID
The bookmark to check.
microsummary
The microsummary to check.
Return value

Returns whether or not the microsummary is the current one for the bookmark.

refreshMicrosummary()

Refreshes a microsummary, updating its value in the datastore and UI. If this method can refresh the microsummary instantly, it will. Otherwise, it'll asynchronously download the necessary information (the generator and/or page) before refreshing the microsummary.

Callers should check the content property of the returned microsummary object to distinguish between sync and async refreshes. If its value is null, then it's an async refresh, and the caller should register itself as an nsIMicrosummaryObserver via nsIMicrosummary.addObserver() to find out when the refresh completes.

nsIMicrosummary refreshMicrosummary(
  in long long bookmarkID
);
Parameters
bookmarkID
The bookmark whose microsummary is being refreshed.
Return value

Returns the microsummary being refreshed.

removeMicrosummary()

Remove the current microsummary for the given bookmark.

void removeMicrosummary(
  in long long bookmarkID
);
Parameters
bookmarkID
The bookmark for which to remove the current microsummary.

setMicrosummary()

Set the current microsummary for the given bookmark.

void setMicrosummary(
  in long long bookmarkID,
  in nsIMicrosummary microsummary
);
Parameters
bookmarkID
The bookmark for which to set the current microsummary.
microsummary
The microsummary to set as the current one.

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, Nickolay, trevorh, Wjjohnst
 Last updated by: Sheppy,