Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Microsummaries: Back-end Implementation

0 views
Skip to first unread message

Myk Melez

unread,
Apr 3, 2006, 5:25:30 PM4/3/06
to
[part of the Microsummaries proposal; posted here for discussion]


Back-end Implementation

The microsummary service updates microsummaries when they expire and
provides an API for front-end code to access microsummaries and be
notified when they get updated.

Like the livemarks service, the microsummary service checks every 15
seconds for microsummaries that need updating. If a microsummary needs
updating, the service downloads the necessary content (i.e. the page or
its feed), processes it to generate an updated microsummary, and stores
the updated microsummary in the datastore.


nsIMicrosummaryService

[scriptable, uuid(c5e9c390-beb0-4eb4-90ab-529efc817632)]
interface nsIMicrosummaryService : nsISupports
{
/**
* Retrieves a list of available microsummaries for a given URI.
* The aDoc argument is optional. If present, this method will use
* it to generate the microsummaries. Otherwise, microsummary
* content may not be available, in which case this method will
* return microsummary objects without content. Callers who
* receive such objects should use the microsummary definition name
* in lieu of microsummary content.
*
* @param aURI the URI of the microsummarized page
* @param aDoc the document to which the URI refers
* @returns an enumerator of nsIMicrosummary objects
*/
nsISimpleEnumerator getMicrosummaries(in nsIURI aURI,
in nsIDOMNode aDoc);

/**
* Manually updates the microsummary for a given URI. The aDoc
* argument is optional. If present, this method will use it to
* update the microsummary. Otherwise it will download the document
* asynchronously.
*
* @param aURI the URI of the microsummarized page
* @param aDoc the document to which the URI refers
*
*/
void updateMicrosummary(in nsIURI aURI, in nsIDOMNode aDoc);

/**
* Sets the microsummary for a given URI.
*
* @param aURI the URI of the microsummarized page
* @param aMicrosummary the microsummary to set
*
*/
void setMicrosummary(in nsIURI aURI,
in nsIMicrosummary aMicrosummary);

/**
* Removes the microsummary for a given URI.
*
* @param aURI the URI of the microsummarized page
*
*/
void removeMicrosummary(in nsIURI aURI);

/**
* Adds a microsummary observer.
*
*/
void addObserver(in nsIAnnotationObserver aObserver);

/**
* Removes a microsummary observer previously registered
* by addObserver.
*
*/
void removeObserver(in nsIAnnotationObserver aObserver);
};


nsIMicrosummaryObserver

[scriptable, uuid(de8ac63a-3867-4dad-a631-ba1d8869d733)]
interface nsIMicrosummaryObserver : nsISupports
{
/**
* Called when the microsummary service starts updating
* a microsummary.
*
* @param aURI the URI of the microsummarized page
*
*/
void onStartUpdate(in nsIURI aURI);

/**
* Called when the microsummary service stops updating
* a microsummary.
*
* @param aURI the URI of the microsummarized page
*
*/
void onStopUpdate(in nsIURI aURI);
};


nsIMicrosummary

[scriptable, uuid(f9d1a73c-e147-46f3-ba61-4f0bd33f5d47)]
interface nsIMicrosummary : nsISupports
{
// for microsummaries specified via a bundled or installed
// definition, the nsIMicrosummaryDefinition for this microsummary
readonly attribute nsIMicrosummaryDefinition definition;

// for microsummaries specified via a <link> element pointing
// to a microsummary definition or RSS/Atom feed, the URI
// of the resource
readonly attribute nsIURI uri;

// the URI of the page being summarized
// XXX Should this be the ID of the page in the history datastore?
readonly attribute nsIURI page;

// the content of the microsummary
readonly attribute nsIDOMNode content;
};


nsIMicrosummaryDefinition

[scriptable, uuid(ff3eba15-81de-4c24-bfcf-c8180dc3c00a)]
interface nsIMicrosummaryDefinition : nsISupports
{
// the unique identifier for this microsummary definition;
// corresponds to the 'id' attribute of the <definition> element
readonly attribute string id;

// the user-friendly name for this microsummary definition;
// corresponds to the 'name' attribute of the <definition> element
readonly attribute string name;

// the XSLT stysheet by which we generate the microsummary;
// corresponds to the <template> child of the <definition> element
readonly attribute nsIDOMNode template;
};

0 new messages